diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-11 10:51:15 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-13 12:56:47 +0200 |
commit | 9df354ac9834f319c1faeef11748b7f1f7afdfae (patch) | |
tree | 2d7e80997097e1684b47902a1bedf25a13ca17b2 /t | |
parent | 65e7ac8c3556d1895ee597811856710143cfc4ac (diff) | |
download | automake-9df354ac9834f319c1faeef11748b7f1f7afdfae.tar.gz |
tests: verify the shell test scripts are syntactically valid
Fixes automake bug#11898.
This measure of extra safety is mostly motivated by the fact that some
shells (at least some versions of Bash in the 3.x release series, one
of which serves as /bin/sh on Mac OS X 10.7, as well as Bash 4.0 and the
/usr/xpg4/bin/sh shell from Solaris 10) erroneously exit with exit status
0 upon encountering a syntax error, if an exit trap is sett (as it is in
our test scripts).
* Makefile.am (check-tests-syntax): New, check that the shell test
scripts listed in $(TESTS) are syntactically correct.
(.PHONY, check-local): Depend on it.
* t/self-check-exit.tap : Remove checks verifying that a script exits
with non-zero status upon encountering a syntax error; as explained
above, we can't depend on that.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/self-check-exit.tap | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap index 0fbc9d8e0..19cf27a87 100755 --- a/t/self-check-exit.tap +++ b/t/self-check-exit.tap @@ -22,7 +22,7 @@ am_create_testdir=no . ./defs || exit 99 -plan_ 34 +plan_ 32 # This test becomes more cumbersome if we keep the 'errexit' shell flag # set. And removing it is no big deal, as this test is a TAP-based one, @@ -79,10 +79,4 @@ test -f Makefile && test ! -x Makefile || \ $AM_TEST_RUNNER_SHELL -c "$init ./Makefile; :" "$dummy_test_script" command_ok_ "permission denied" test $? -gt 0 -: Syntax errors in the test code. -$AM_TEST_RUNNER_SHELL -c "$init if :; then" "$dummy_test_script" -command_ok_ "syntax error 1" test $? -gt 0 -$AM_TEST_RUNNER_SHELL -c "$init true ( true )" "$dummy_test_script" -command_ok_ "syntax error 2" test $? -gt 0 - : |