A simple patch that fixes another test script which does not set the `errexit' shel flag, and which can experience false negatives (small, in this case).
Regards, Stefano --- Use `set -e' in confsub.test (avoid false negatives). * tests/confsub.test: Enable shell `errexit' flag, and related changes (this helps avoiding some possible minor false negatives). Also, bumped copyright years. No portability problems should be introduced, since the test script uses mostly simple commands (no shell functions, no shell control structures and almost no compound commands); the only exception is a compound command whose purpose is to cause the test to fail if unexpected text is found in a generated Makefile.in: ($FGREP ... subdir/Makefile.in | $FGREP -v ...) && Exit 1 However, we don't expect this to cause problems, as similar commands are already used anyway in test script using the `errexit' flag', such as nolink.test: grep '^meal.*:' Makefile.in | grep -v beef.meat && Exit 1 and color.test: cat stdout | grep ": pass" | $FGREP "$grn" && Exit 1
From 6c317d849d5fc580e6aa4919620fe2809fbb00f0 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Fri, 9 Apr 2010 18:24:34 +0200 Subject: [PATCH 1/2] Use `set -e' in confsub.test (avoid false negatives). * tests/confsub.test: Enable shell `errexit' flag, and related changes (this helps avoiding some possible minor false negatives). Also, bumped copyright years. No portability problems should be introduced, since the test script uses mostly simple commands (no shell functions, no shell control structures and almost no compound commands); the only exception is a compound command whose purpose is to cause the test to fail if unexpected text is found in a generated Makefile.in: ($FGREP ... subdir/Makefile.in | $FGREP -v ...) && Exit 1 However, we don't expect this to cause problems, as similar commands are already used anyway in test script using the `errexit' flag', such as nolink.test: grep '^meal.*:' Makefile.in | grep -v beef.meat && Exit 1 and color.test: cat stdout | grep ": pass" | $FGREP "$grn" && Exit 1 --- ChangeLog | 7 +++++++ tests/confsub.test | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a5b5426..c23ac81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-09 Stefano Lattarini <stefano.lattar...@gmail.com> + + Use `set -e' in confsub.test (avoids possible false negatives). + * tests/confsub.test: Enable shell `errexit' flag, and related + changes (this helps avoiding some possible minor false negatives). + Also, bumped copyright years. + 2010-04-04 Stefano Lattarini <stefano.lattar...@gmail.com> Generated tests are now just a thin layer around other tests. diff --git a/tests/confsub.test b/tests/confsub.test index 40c90c5..c96dc84 100755 --- a/tests/confsub.test +++ b/tests/confsub.test @@ -20,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(nonesuch, nonesuch) @@ -37,8 +39,8 @@ END echo 'Before.' > subdir/config.hin -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE # Make sure subdir Makefile.in doesn't itself look in the subdir. # One line is allowed though: @@ -47,13 +49,11 @@ $AUTOMAKE || Exit 1 ($FGREP 'subdir/config.h' subdir/Makefile.in | $FGREP -v 'cd $(top_builddir)') && Exit 1 -$AUTOCONF || Exit 1 -./configure || Exit 1 +$AUTOCONF +./configure $FGREP 'Before.' subdir/config.h $sleep echo 'After.' > subdir/config.hin -$MAKE || Exit 1 -$FGREP 'After.' subdir/config.h || Exit 1 - -Exit 0 +$MAKE +$FGREP 'After.' subdir/config.h -- 1.6.5