From: Stefano Lattarini Date: Thu, 20 Oct 2011 19:31:09 +0000 (+0200) Subject: tests: fix spurious failures with "chatty" make implementations X-Git-Tag: v1.11.1b~16^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65c015849f02bec4b7c106758be71db12f602d73;p=thirdparty%2Fautomake.git tests: fix spurious failures with "chatty" make implementations * tests/distcheck-missing-m4.test: On failure, some make implementations (such as Solaris make) print the whole failed recipe on standard output. This was causing a spurious failure in the checks grepping the output from make. Work around this. * tests/distcheck-outdated-m4.test: Likewise. --- diff --git a/ChangeLog b/ChangeLog index c87185f98..9e81436e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-10-20 Stefano Lattarini + + tests: fix spurious failures with "chatty" make implementations + * tests/distcheck-missing-m4.test: On failure, some make + implementations (such as Solaris make) print the whole failed + recipe on standard output. This was causing a spurious failure + in the checks grepping the output from make. Work around this. + * tests/distcheck-outdated-m4.test: Likewise. + 2011-10-20 Stefano Lattarini tests: fix spurious failure on fast machines diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.test index 1a2b62f42..1d42748ab 100755 --- a/tests/distcheck-missing-m4.test +++ b/tests/distcheck-missing-m4.test @@ -65,6 +65,15 @@ $AUTOCONF $EGREP 'MY_(FOO|BAR|BAZ|ZAR)' configure && Exit 1 # Sanity check. $AUTOMAKE +check_no_spurious_error () +{ + $EGREP -i 'mkdir:|:.*(permission|denied)' output && Exit 1 + # On failure, some make implementations (such as Solaris make) print the + # whole failed recipe on stdout. The first grep works around this. + grep -v 'rm -rf ' output | grep -i 'autom4te.*\.cache' && Exit 1 + : # To placate `set -e'. +} + ./configure $MAKE distcheck >output 2>&1 && { cat output; Exit 1; } @@ -72,8 +81,7 @@ cat output for x in bar baz zar; do $EGREP "required m4 file.*not distributed.* $x.m4( |$)" output done -# Check that we don't fail for spurious errors. -$EGREP -i 'mkdir:|autom4te.*\.cache|:.*(permission|denied)' output && Exit 1 +check_no_spurious_error # Now we use `--install', and "make distcheck" should pass. $ACLOCAL -I m4 --install @@ -98,8 +106,7 @@ $MAKE distcheck >output 2>&1 && { cat output; Exit 1; } cat output $EGREP "required m4 file.*not distributed.* qux.m4( |$)" output $EGREP "required m4 file.*not distributed.* bla.m4( |$)" output -# Check that we don't fail for spurious errors. -$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1 +check_no_spurious_error # Check that we don't complain for files that should have been found. $FGREP " (bar|baz|zar).m4" output && Exit 1 diff --git a/tests/distcheck-outdated-m4.test b/tests/distcheck-outdated-m4.test index 7a3ade86b..e3f265e39 100755 --- a/tests/distcheck-outdated-m4.test +++ b/tests/distcheck-outdated-m4.test @@ -59,6 +59,15 @@ $AUTOMAKE ./configure $MAKE distcheck # Sanity check. +check_no_spurious_error () +{ + $EGREP -i 'mkdir:|:.*(permission|denied)' output && Exit 1 + # On failure, some make implementations (such as Solaris make) print the + # whole failed recipe on stdout. The first grep works around this. + grep -v 'rm -rf ' output | grep -i 'autom4te.*\.cache' && Exit 1 + : # To placate `set -e'. +} + # We start to use a new "third-party" macro in a new version # of a pre-existing third-party m4 file, but forget to re-run # "aclocal --install" by hand, relying on automatic remake @@ -76,8 +85,7 @@ $MAKE distcheck >output 2>&1 && { cat output; Exit 1; } cat output $EGREP "required m4 file.* outdated.* baz.m4( |$)" output -# Check that we don't fail for spurious errors. -$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1 +check_no_spurious_error # Check that we don't complain for files that aren't outdated. $EGREP " (foo|bar).m4" output && Exit 1 @@ -117,10 +125,8 @@ END $MAKE # Rebuild configure and makefiles. $MAKE distcheck >output 2>&1 && { cat output; Exit 1; } cat output - $EGREP "required m4 file.* outdated.* fnord.m4( |$)" output -# Check that we don't fail for spurious errors. -$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1 +check_no_spurious_error # Check that we don't complain for files that aren't outdated. $EGREP " (foo|bar|baz).m4" output && Exit 1