summaryrefslogtreecommitdiff
path: root/t/missing3.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-07-23 13:35:28 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-07-23 13:35:28 +0200
commit43619a0fa3edc6c0c4ce3b49835d2c48c4afb862 (patch)
tree5978fcc6f35a614d819a3db1ecdbf7981deb969d /t/missing3.sh
parent54a47b07f8385136ed85626093cdff94dc7124fd (diff)
downloadautomake-43619a0fa3edc6c0c4ce3b49835d2c48c4afb862.tar.gz
tests: avoid a spurious failure with Solaris /bin/sh
The /bin/sh shell on Solaris is dumb enough not to set the exit status to 127 after the execution of a non-existing command is attempted: $ /bin/sh -c 'nonesuch'; echo stat = $? /bin/sh: nonesuch: not found stat = 1 This means that the missing script, when run through that shell, cannot discriminate between a real failure of a maintainer tool and a failure due to its absence. This is not a big deal in practice (especially because all the 'missing' invocations in our Makefiles are done with $(SHELL), and that is almost surely set by configure to a proper POSIX shell), but was causing an annoying failure in our testsuite. Fix it. * t/missing3.sh: If 'missing' is run with a /bin/sh shell suffering from the just-described bug, skip the check that would spuriously fail due to that bug. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/missing3.sh')
-rwxr-xr-xt/missing3.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/missing3.sh b/t/missing3.sh
index 27dcd121c..b2cacf979 100755
--- a/t/missing3.sh
+++ b/t/missing3.sh
@@ -34,7 +34,14 @@ run_cmd ()
run_cmd ./missing b7cb8259 --version && exit 1
grep WARNING stderr && exit 1
run_cmd ./missing b7cb8259 --grep && exit 1
-grep 'WARNING:.*missing on your system' stderr
+
+if test x"$am_test_prefer_config_shell" != x"yes"; then
+ # The /bin/sh from Solaris 10 is a spectacular failure. After a failure
+ # due to a "command not found", it sets '$?' to '1'.
+ if (st=0; /bin/sh -c 'no--such--command' || st=$?; test $st -eq 127); then
+ grep 'WARNING:.*missing on your system' stderr
+ fi
+fi
# missing itself it known to exist :)