automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI 4/4] {testsuite-work} self tests: work around 'unset' spurious non-


From: Stefano Lattarini
Subject: [FYI 4/4] {testsuite-work} self tests: work around 'unset' spurious non-zero return value
Date: Tue, 13 Sep 2011 16:19:41 +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                 |    8 ++++++++
 tests/self-check-exit.tap |    6 +++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8c9615b..7b30dd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-09-13  Stefano Lattarini  <address@hidden>
 
+       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  <address@hidden>
+
        tests: an explicative comment on signal-related woes
        * tests/self-check-exit.tap: Add pointer to a bug-autoconf
        discussion explaining why this test needs to temporarily block
diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap
index 5ac8b8f..9fe2905 100755
--- a/tests/self-check-exit.tap
+++ b/tests/self-check-exit.tap
@@ -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
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]