]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
self tests: work around 'unset' spurious non-zero return value
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 13 Sep 2011 13:49:32 +0000 (15:49 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 13 Sep 2011 13:49:32 +0000 (15:49 +0200)
* tests/self-check-exit.tap ($init): Unset the possibly already
unset variable `am_explicit_skips' when the `errexit' shell flag
is not yet active, for the benefit of shell that return a non-zero
status when unsetting an already-unset variable.

ChangeLog
tests/self-check-exit.tap

index 8c9615b6e2d2bbccb535d9a6d532af893c218f2b..7b30dd99e89c342b11821192fd50a57db3790b1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       self tests: work around 'unset' spurious non-zero return value
+       * tests/self-check-exit.tap ($init): Unset the possibly already
+       unset variable `am_explicit_skips' when the `errexit' shell flag
+       is not yet active, for the benefit of shell that return a non-zero
+       status when unsetting an already-unset variable.
+
 2011-09-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: an explicative comment on signal-related woes
index 5ac8b8f0ed1430d044819e2b747adfb36d46d0a3..9fe2905b05c177c2e6886a67df85682fd7a71463 100755 (executable)
@@ -31,7 +31,11 @@ set +e
 
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
-init='. ./defs; stderr_fileno_=2; unset am_explicit_skips'
+# It's especially important that the `unset' is done before sourcing
+# ./defs, i.e., when `set -e' is not active yet, for the benefit of shells
+# (like Bash 2.05 and Solaris 10 /bin/ksh) that returns a non-zero status
+# when unsetting an already-unset variable.
+init='stderr_fileno_=2; unset am_explicit_skips; . ./defs'
 
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
   for exit_cmd in "Exit $st" "sh -c 'exit $st'"; do