diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-17 13:45:44 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-17 15:40:35 +0200 |
commit | 84e12c32964ef8454be946b4b2eeb46766ca9add (patch) | |
tree | b397fb95a2b599f73e9fc19e228178881c0c3ce9 /t/auxdir-autodetect.sh | |
parent | 176d229b5136806a6f34d18f08dfc986e6c26c76 (diff) | |
download | automake-84e12c32964ef8454be946b4b2eeb46766ca9add.tar.gz |
tests: sanitize 'unset' usages
In some shells (e.g., Solaris 10 /bin/ksh, or NetBSD 5.1 /bin/sh),
"unset VAR" returns a non-zero exit status in case the VAR variable
is already unset. This doesn't interact well with our usage of
"set -e" in the testsuite. So far, we've avoided spurious failures
by either explicitly ignoring the exit status from unset:
unset VAR || :
or explicitly ensuring that a variable is set, before trying to
unset it:
VAR=; unset VAR
But we can do better, by aliasing the 'unset' command to a custom
function that will take care of these details for us. This will
avoid us annoying spurious failures in the future, failures that
have already bitten us too much times. For an example, refer to
commit 'v1.12.2-88-g5b1dae5' of 2012-08-05 (tests: avoid tons of
spurious failures on NetBSD).
* t/ax/test-lib.sh (_am_unset): New function.
(unset): New alias to it.
(_am_exit): Adjust comments.
* t/ax/am-test-lib.sh: No need to temporary disable the 'errexit'
shell flag when unsetting variables that are potentially already
unset.
(am_process_requirements): Adjust to remove a now-useless
workaround related to unset.
* t/aclocal-macrodir.tap: Likewise.
* t/aclocal-macrodirs.tap: Likewise.
* t/auxdir-autodetect.sh: Likewise.
* t/ax/am-test-lib.sh: Likewise.
* t/ax/test-lib.sh: Likewise.
* t/check-tests-in-builddir.sh: Likewise.
* t/dist-formats.tap: Likewise.
* t/distcheck-configure-flags-am.sh: Likewise.
* t/distcheck-configure-flags.sh: Likewise.
* t/java-empty-classpath.sh: Likewise.
* t/javaflags.sh: Likewise.
* t/lflags.sh: Likewise.
* t/lflags2.sh: Likewise.
* t/lisp-flags.sh: Likewise.
* t/lisp6.sh: Likewise.
* t/missing-auxfile-stops-makefiles-creation.sh: Likewise.
* t/parallel-am.sh: Likewise.
* t/parallel-am2.sh: Likewise.
* t/parallel-am3.sh: Likewise.
* t/parallel-tests-log-override-recheck.sh: Likewise.
* t/pkg-config-macros.sh: Likewise.
* t/python-missing.sh: Likewise.
* t/python-too-old.sh: Likewise.
* t/python11.sh: Likewise.
* t/self-check-dir.tap: Likewise.
* t/self-check-report.sh: Likewise.
* t/self-check-seq.tap: Likewise.
* t/silent-configsite.sh: Likewise.
* t/suffix6c.sh: Likewise.
* t/tar-override.sh: Likewise.
* t/tests-environment-and-log-compiler.sh: Likewise.
* t/vala-configure.sh: Likewise.
* t/werror3.sh: Likewise.
* t/yflags-cmdline-override.sh: Likewise.
* t/yflags.sh: Likewise.
* t/yflags2.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/auxdir-autodetect.sh')
-rw-r--r-- | t/auxdir-autodetect.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/auxdir-autodetect.sh b/t/auxdir-autodetect.sh index 17567c0fc..457e06a52 100644 --- a/t/auxdir-autodetect.sh +++ b/t/auxdir-autodetect.sh @@ -21,7 +21,7 @@ nil=__no_such_program -unset NONESUCH || : +unset NONESUCH cat >>configure.ac << END AM_MISSING_PROG([NONESUCH],[$nil]) |