* 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.
---
 ChangeLog                        |    9 +++++++++
 tests/distcheck-missing-m4.test  |   15 +++++++++++----
 tests/distcheck-outdated-m4.test |   16 +++++++++++-----
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c87185f..9e81436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-10-20  Stefano Lattarini  <stefano.lattar...@gmail.com>
 
+       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  <stefano.lattar...@gmail.com>
+
        tests: fix spurious failure on fast machines
        * tests/aclocal-path-precedence.test: Also remove the `configure'
        script between different test runs, to ensure it is always remade
diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.test
index 1a2b62f..1d42748 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 7a3ade8..e3f265e 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
 
-- 
1.7.2.3


Reply via email to