From: Stefano Lattarini Date: Mon, 26 Apr 2010 08:46:43 +0000 (+0200) Subject: Extend tests/README (trailing `:' in test scripts) X-Git-Tag: v1.11.1b~75^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12e9334a5eac926a69e30979118954ec3eee1781;p=thirdparty%2Fautomake.git Extend tests/README (trailing `:' in test scripts) * tests/README (section "Writing test cases" subsection "Do"): Explain why apparently redundant trailing `:' and `Exit 0' in test scripts can indeed be useful. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index c2d62cfbe..3c25fb92e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-06-12 Stefano Lattarini + Ralf Wildenhues + + Extend tests/README w.r.t. trailing `:' in test scripts. + * tests/README (section "Writing test cases" subsection "Do"): + Explain why apparently redundant trailing `:' and `Exit 0' in + test scripts can indeed be useful. + 2010-06-11 Stefano Lattarini Improve determination of PATH separator in bootstrap script. diff --git a/tests/README b/tests/README index 095d17691..7d74083c6 100644 --- a/tests/README +++ b/tests/README @@ -111,6 +111,13 @@ Do Use `set -e' to catch failures you might not have thought of. + End the test script with a `:' or `Exit 0'. Otherwise, when somebody + changes the test by adding a failing command after the last command, + the test will spuriously fail because $? is nonzero at the end. + Note that this is relevant also for tests using `set -e', if they + contain commands like "grep ... Makefile.in && Exit 1" (and there + are indeed a lot of such tests). + Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER, $PERL, $MAKE, $EGREP, and $FGREP, instead of the corresponding commands.