]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: never source test-defs.sh directly, source test-lib.sh instead
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 10:50:32 +0000 (12:50 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 12:11:40 +0000 (14:11 +0200)
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>
gen-testsuite-part
t/tap-summary-color.sh
t/tap-summary.sh
t/testsuite-summary-color.sh
t/testsuite-summary-count.sh

index d646b27690c427c960ef20f44e2771d2058c8d3a..21c26c46d3f97a29c139f3959d1c267cf236ed1d 100755 (executable)
@@ -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.
index c84e848389389feca0e52340b4148ad307a7a77b..e9b516bbc7b1b36369c14a0401cba361f74eda7e 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. test-defs.sh
+. test-lib.sh
 
 use_colors=yes
 . tap-summary-aux.sh
index 6e0e798f8725da262bbe9faa057b074a67fa4482..c4bd739373a428a6608d5be2dcf2e245a2f42176 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. test-defs.sh
+. test-lib.sh
 
 use_colors=no
 . tap-summary-aux.sh
index a0effd6893f9759b8fbb19bbdf83b4beea58ea88..7278a2f8c15a940a3a8e5ded7991fb23eff370c2 100755 (executable)
 
 # 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
index 47bb66317106c9c4db1e3b52ba2d435d077f041d..25ecf27508ccb17b91b4d19a8070266cfb0043ae 100755 (executable)
 
 # 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