From: Stefano Lattarini Date: Tue, 13 Sep 2011 13:49:32 +0000 (+0200) Subject: self tests: work around 'unset' spurious non-zero return value X-Git-Tag: ng-0.5a~89^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f797ab76bdc21b4b9916c10f6fdce93c1c4b30c;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 8c9615b6e..7b30dd99e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-09-13 Stefano Lattarini + + 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 tests: an explicative comment on signal-related woes diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap index 5ac8b8f0e..9fe2905b0 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