[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 32/32] tests: never source test-defs.sh directly, source test-lib
From: |
Stefano Lattarini |
Subject: |
[PATCH 32/32] tests: never source test-defs.sh directly, source test-lib.sh instead |
Date: |
Thu, 26 Jul 2012 14:04:58 +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 <address@hidden>
---
gen-testsuite-part | 2 +-
t/tap-summary-color.sh | 2 +-
t/tap-summary.sh | 2 +-
t/testsuite-summary-color.sh | 6 ++----
t/testsuite-summary-count.sh | 6 ++----
5 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/gen-testsuite-part b/gen-testsuite-part
index d646b27..21c26c4 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 c84e848..e9b516b 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 6e0e798..c4bd739 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 a0effd6..7278a2f 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 47bb663..25ecf27 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
--
1.7.12.rc0
- [PATCH 27/32] configure: testsuite shell can return early from "dot-sourced" files, (continued)
- [PATCH 27/32] configure: testsuite shell can return early from "dot-sourced" files, Stefano Lattarini, 2012/07/26
- [PATCH 25/32] tests: source test defs in the generic test lib, Stefano Lattarini, 2012/07/26
- [PATCH 22/32] test setup: move actual calling of testsuite setup in ./defs, Stefano Lattarini, 2012/07/26
- [PATCH 26/32] tests: move sanitization and "Bournification" in the generic test lib, Stefano Lattarini, 2012/07/26
- [PATCH 24/32] test defs: no need to re-add $srcdir/t/ax to $PATH, Stefano Lattarini, 2012/07/26
- [PATCH 20/32] test init: refactor: new function 'am_test_setup', Stefano Lattarini, 2012/07/26
- [PATCH 28/32] tests: protect test libs against multiple inclusion, Stefano Lattarini, 2012/07/26
- [PATCH 29/32] tests: "am_using_tap=yes" -> "am_test_protocol=tap", Stefano Lattarini, 2012/07/26
- [PATCH 31/32] runtest: sanitize test environment, Stefano Lattarini, 2012/07/26
- [PATCH 30/32] tests: remove an obsolescent self test, Stefano Lattarini, 2012/07/26
- [PATCH 32/32] tests: never source test-defs.sh directly, source test-lib.sh instead,
Stefano Lattarini <=
- [PATCH 33/32] maintcheck: fixup list of files in $(xdefs), Stefano Lattarini, 2012/07/26
- Re: [PATCH 00/32] {maint} Several testsuite refactorings, Stefano Lattarini, 2012/07/26