+2011-10-20 Stefano Lattarini <stefano.lattarini@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.lattarini@gmail.com>
tests: fix spurious failure on fast machines
$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; }
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
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
./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
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
$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