From 6118be808ccf4b21ea178946784848cd87b790b4 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Sun, 10 Jul 2016 09:04:44 +1000 Subject: [PATCH] misc: testsuite to source aux scripts correctly Because I don't know how to redirect properly in tcl, there are some small scripts that do this for me. With your standard make check, all is good because the scripts and the binary are in the usual spots. make distcheck however puts them all over the place. The binary is in a different tree to the test and aux scripts. The change now tells where aux script where its binary is. --- testsuite/lib.test/fileutils.exp | 13 +++++++------ testsuite/lib.test/fileutils_badfd.sh | 4 ++-- testsuite/lib.test/fileutils_full.sh | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/testsuite/lib.test/fileutils.exp b/testsuite/lib.test/fileutils.exp index 3fab11e2..da4e6e73 100644 --- a/testsuite/lib.test/fileutils.exp +++ b/testsuite/lib.test/fileutils.exp @@ -2,18 +2,19 @@ # Testsuite for lib/fileutils program # -set noarg "${topdir}lib/test_fileutils" +set testprog "${topdir}lib/test_fileutils" +set scriptdir [file dirname [ info script ]] set test "without argument" -spawn $noarg +spawn $testprog expect_pass "$test" "Hello, World!" -set badfd "${topdir}testsuite/lib.test/fileutils_badfd.sh" +set badfd "${scriptdir}/fileutils_badfd.sh" set test "test bad file descriptor" -spawn $badfd +spawn $badfd $testprog expect_pass "$test" "test_fileutils: write error: Bad file descriptor" -set full "${topdir}testsuite/lib.test/fileutils_full.sh" +set full "${scriptdir}/fileutils_full.sh" set test "test no space left on device" -spawn $full +spawn $full $testprog expect_pass "$test" "test_fileutils: write error: No space left on device" diff --git a/testsuite/lib.test/fileutils_badfd.sh b/testsuite/lib.test/fileutils_badfd.sh index 4a0d5c67..6fffb243 100755 --- a/testsuite/lib.test/fileutils_badfd.sh +++ b/testsuite/lib.test/fileutils_badfd.sh @@ -1,4 +1,4 @@ #!/bin/sh -BASEDIR=$(dirname ${0}) -${BASEDIR}/../../lib/test_fileutils >&- +TESTPROG=${1} +${TESTPROG} >&- diff --git a/testsuite/lib.test/fileutils_full.sh b/testsuite/lib.test/fileutils_full.sh index 0d96a0dd..dd8f61c7 100755 --- a/testsuite/lib.test/fileutils_full.sh +++ b/testsuite/lib.test/fileutils_full.sh @@ -1,4 +1,4 @@ #!/bin/sh -BASEDIR=$(dirname ${0}) -${BASEDIR}/../../lib/test_fileutils > /dev/full +TESTPROG=${1} +${TESTPROG} >/dev/full