summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-07-26 12:50:32 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-07-26 14:11:40 +0200
commitf2b8b7659ae48941ab0be64d1663dd673e097d58 (patch)
treeb4f89923c6d3bda7b705f7109928474a0141a6b1
parentdb188c29be11177499d4c96bd2b8327e884f7d8c (diff)
downloadautomake-f2b8b7659ae48941ab0be64d1663dd673e097d58.tar.gz
tests: never source test-defs.sh directly, source test-lib.sh instead
After the recent re-organization, sourcing 'test-defs.sh' directly might not work well and cause spurious failures or other unexpected behaviours. We should source 'test-lib.sh' instead, which contains not more direct code execution (only definition of shell variables/functions, or sourcing of other '*.sh' with the same property), is protected against multiple inclusions, and sources 'test-defs.sh' automatically in in a proper way. * t/testsuite-summary-count.sh, t/tap-summary.sh, t/tap-summary-color.sh, t/testsuite-summary-color.sh: Source 'test-lib.sh', not 'test-defs.sh'. * gen-testsuite-part: Likewise, in the generated wrapper scripts. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rwxr-xr-xgen-testsuite-part2
-rwxr-xr-xt/tap-summary-color.sh2
-rwxr-xr-xt/tap-summary.sh2
-rwxr-xr-xt/testsuite-summary-color.sh6
-rwxr-xr-xt/testsuite-summary-count.sh6
5 files changed, 7 insertions, 11 deletions
diff --git a/gen-testsuite-part b/gen-testsuite-part
index d646b2769..21c26c46d 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -96,7 +96,7 @@ sub write_wrapper_script ($$$)
print $file_handle unindent <<EOF;
#! /bin/sh
# This file has been automatically generated. DO NOT EDIT BY HAND!
- . test-defs.sh
+ . test-lib.sh
$shell_setup_code
# In the spirit of VPATH, we prefer a test in the build tree
# over one in the source tree.
diff --git a/t/tap-summary-color.sh b/t/tap-summary-color.sh
index c84e84838..e9b516bbc 100755
--- a/t/tap-summary-color.sh
+++ b/t/tap-summary-color.sh
@@ -17,7 +17,7 @@
# TAP support:
# - colorized testsuite summary
-. test-defs.sh
+. test-lib.sh
use_colors=yes
. tap-summary-aux.sh
diff --git a/t/tap-summary.sh b/t/tap-summary.sh
index 6e0e798f8..c4bd73937 100755
--- a/t/tap-summary.sh
+++ b/t/tap-summary.sh
@@ -17,7 +17,7 @@
# TAP support:
# - colorized testsuite summary
-. test-defs.sh
+. test-lib.sh
use_colors=no
. tap-summary-aux.sh
diff --git a/t/testsuite-summary-color.sh b/t/testsuite-summary-color.sh
index a0effd689..7278a2f8c 100755
--- a/t/testsuite-summary-color.sh
+++ b/t/testsuite-summary-color.sh
@@ -16,11 +16,9 @@
# Check coloring of the testsuite summary.
-. test-defs.sh
-
-use_colors=yes
-use_vpath=no
+. test-lib.sh
+use_colors=yes; use_vpath=no
. testsuite-summary-checks.sh
./configure
diff --git a/t/testsuite-summary-count.sh b/t/testsuite-summary-count.sh
index 47bb66317..25ecf2750 100755
--- a/t/testsuite-summary-count.sh
+++ b/t/testsuite-summary-count.sh
@@ -16,11 +16,9 @@
# Check test counts in the testsuite summary.
-. test-defs.sh
-
-use_colors=no
-use_vpath=no
+. test-lib.sh
+use_colors=no; use_vpath=no
. testsuite-summary-checks.sh
./configure