]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] tests: prefer to grep make stderr for expected diagnostic
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Apr 2012 08:03:38 +0000 (10:03 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Apr 2012 08:40:44 +0000 (10:40 +0200)
Few make implementations, like BSD's, can print diagnostic from make or
its spawned recipes on stdout rather than on stderr.  Some of our tests
had been relaxed to cater for this.  Now that we assume GNU make, there
is no reason to be this "sloppy" anymore.

* t/uninstall-fail.sh: Expect diagnostic from make and its recipes
to be on stderr, not possibly also on stdout.
* t/lisp3.sh: Likewise.
* t/test-missing.sh: Likewise.
* t/test-missing2.sh: Likewise.
* t/distcheck-pr10470.sh: Likewise.
* t/distcheck-pr9579.sh: Likewise.
* t/dist-missing-am.sh: Likewise.
* t/dist-missing-included-m4.sh: Likewise.
* t/dist-missing-m4.sh: Likewise.
* t/deleted-am.sh: Likewise.
* t/deleted-m4.sh: Likewise.
* t/distcheck-configure-flags-am.sh: Likewise.
* t/distcheck-configure-flags-subpkg.sh: Likewise.
* t/distcheck-configure-flags.sh: Likewise.
* t/yacc-dist-nobuild.sh: Likewise.  Also, be stricter in matching
expected make diagnostic.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
16 files changed:
t/colon6.sh
t/deleted-am.sh
t/deleted-m4.sh
t/dist-missing-am.sh
t/dist-missing-included-m4.sh
t/dist-missing-m4.sh
t/distcheck-configure-flags-am.sh
t/distcheck-configure-flags-subpkg.sh
t/distcheck-configure-flags.sh
t/distcheck-pr10470.sh
t/distcheck-pr9579.sh
t/lisp3.sh
t/test-missing.sh
t/test-missing2.sh
t/uninstall-fail.sh
t/yacc-dist-nobuild.sh

index 09cc2eb15ab95537291fb69733689ebfcb69c3de..bf2dacd7dc810da93f7c4f6add996c6502b8afc0 100755 (executable)
@@ -82,10 +82,10 @@ for vpath in : false; do
 
   # version.good should depend on version.gin.
   rm -f version.good
-  $MAKE version.good >output 2>&1 && { cat output; Exit 1; }
-  cat output
+  $MAKE version.good 2>stderr && { cat stderr >&2; Exit 1; }
+  cat stderr >&2
   # Try to verify that we errored out for the right reason.
-  $FGREP version.gin output
+  $FGREP version.gin stderr
 
   cd .. # Back in top builddir.
   cd $srcdir
index e8e7a2268637cb62989fee143c8911d44442a235..e3612a339388dfe565704c0b5298d2bfecbcbfb1 100755 (executable)
@@ -35,12 +35,12 @@ $AUTOMAKE
 $MAKE
 
 rm -f zardoz.am
-$MAKE >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # This error will come from automake, not make, so we can be stricter
 # in our grepping of it.
-grep 'cannot open.*zardoz\.am' output
-grep 'foobar\.am' output && Exit 1 # No spurious error, please.
+grep 'cannot open.*zardoz\.am' stderr
+grep 'foobar\.am' stderr && Exit 1 # No spurious error, please.
 
 # Try with one less indirection.
 : > foobar.am
@@ -48,10 +48,10 @@ $AUTOMAKE Makefile
 ./config.status Makefile
 $MAKE # Sanity check.
 rm -f foobar.am
-$MAKE >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # This error will come from automake, not make, so we can be stricter
 # in our grepping of it.
-grep 'cannot open.*foobar\.am' output
+grep 'cannot open.*foobar\.am' stderr
 
 :
index e1bbfce4a60e052e7704c4999a4b4127c08cbdc6..328657e18565cf05f321be9c43cdb06e9de01e74 100755 (executable)
@@ -39,13 +39,13 @@ $AUTOMAKE
 $MAKE
 
 rm -f zardoz.m4
-$MAKE >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # This error will come from aclocal, not make, so we can be stricter
 # in our grepping of it.
-grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' output
+grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' stderr
 # No spurious errors, please.
-$FGREP -v ' foobar.m4:1:' output | $FGREP 'foobar.m4' && Exit 1
+$FGREP -v ' foobar.m4:1:' stderr | $FGREP 'foobar.m4' && Exit 1
 
 # Try with one less indirection.
 : > foobar.m4
@@ -54,12 +54,12 @@ $AUTOCONF
 ./configure
 $MAKE # Sanity check.
 rm -f foobar.m4
-$MAKE >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # This error will come from aclocal, not make, so we can be stricter
 # in our grepping of it.
-grep 'foobar\.m4.*does not exist' output
+grep 'foobar\.m4.*does not exist' stderr
 # No spurious errors, please (ok, this is really paranoid).
-$FGREP 'zardoz.m4' output && Exit 1
+$FGREP 'zardoz.m4' stderr && Exit 1
 
 :
index 0765b0c59ac8da5eea14a916a32fbea89b9ea2a5..3a088c083ba3f9446bec4d578237c37d67aa9284 100755 (executable)
@@ -54,12 +54,12 @@ for vpath in false :; do
     cd $distdir
     ./configure
   fi
-  $MAKE >output 2>&1 && { cat output; Exit 1; }
-  cat output
+  $MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+  cat stderr >&2
   # This error comes from automake, not make, so we can be stricter
   # in our grepping of it.
-  grep 'cannot open.*zardoz\.am' output
-  grep 'foobar\.am' output && Exit 1 # No spurious error, please.
+  grep 'cannot open.*zardoz\.am' stderr
+  grep 'foobar\.am' stderr && Exit 1 # No spurious error, please.
   cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory"
 done
 
index 59600036cbbb3c4bc97b46679a7f4989e4cdf2eb..480301b6564b9ac337bb2552d5161b8cd9f6a2ac 100755 (executable)
@@ -56,12 +56,12 @@ for vpath in false :; do
     cd $distdir
     ./configure
   fi
-  $MAKE >output 2>&1 && { cat output; Exit 1; }
-  cat output
+  $MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+  cat stderr
   # This error will come from automake, not make, so we can be stricter
   # in our grepping of it.
-  grep 'zardoz\.m4.*does not exist' output
-  grep 'foobar\.m4' output && Exit 1 # No spurious error, please.
+  grep 'zardoz\.m4.*does not exist' stderr
+  grep 'foobar\.m4' stderr && Exit 1 # No spurious error, please.
   cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory"
 done
 
index 9a418d31618040daca78cb3ec851d31050791208..678e67a9a6639589c887e2f505bc1cf5d18f3c51 100755 (executable)
@@ -58,12 +58,12 @@ for vpath in false :; do
     cd $distdir
     ./configure
   fi
-  $MAKE >output 2>&1 && { cat output; Exit 1; }
-  cat output
+  $MAKE 2>stderr && { cat stderr; Exit 1; }
+  cat stderr
   # This error will come from autoconf, not make, so we can be stricter
   # in our grepping of it.
-  grep 'possibly undefined .*MY_ZARDOZ' output
-  grep 'MY_FOOBAR' output && Exit 1 # No spurious error, please.
+  grep 'possibly undefined .*MY_ZARDOZ' stderr
+  grep 'MY_FOOBAR' stderr && Exit 1 # No spurious error, please.
   cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory"
 done
 
index 7dbe2ab3de6ee97bf2b052d6d7b01691d5571bd9..be214ffcb4c0a04ccb161dfb9f0894570ad30287 100755 (executable)
@@ -59,9 +59,9 @@ END
 $AUTOMAKE Makefile
 ./config.status Makefile
 
-$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
-cat output
-grep "^configure:.* success='no', sentence='it works :-)'" output
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep "^configure:.* success='no', sentence='it works :-)'" stderr
 
 $MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-success=yes"
 
index 45d0e0cb6d21d3476716b06da55d6acda2a7b5e6..17dfc9cbb7d99d9cff06be498ceb0629bd38a3cd 100755 (executable)
@@ -74,8 +74,8 @@ $MAKE distcheck
 
 # ... but not when "make distcheck" is run from the subpackage.
 cd subpkg
-$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
-cat output
-grep '^configure:.* dc=KO am_dc=KO' output
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '^configure:.* dc=KO am_dc=KO' stderr
 
 :
index aec3ec4b042fff5e32f748bc2d8db5487cc06e44..bb6f840a51c298039278199e87bfbda2b299217c 100755 (executable)
@@ -48,8 +48,8 @@ $MAKE distcheck \
   DISTCHECK_CONFIGURE_FLAGS="--enable-success=yes sentence='it works :-)'"
 
 # Sanity check.
-$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
-cat output
-grep "^configure:.* success='no', sentence=''" output
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep "^configure:.* success='no', sentence=''" stderr
 
 :
index 1b6a3226acd25b8e9223cb309c5714cec4b7cc6d..efb4380a3cb4c2769f4e804f09c054bf0fde0e57 100755 (executable)
@@ -50,10 +50,10 @@ $AUTOMAKE
 ./configure
 
 # We can build the distribution.
-$MAKE distcheck >output 2>&1 || { cat output; Exit 1; }
-cat output
+$MAKE distcheck 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # Sanity check: verify that our code has hit a problem removing
 # the distdir, but has recovered from it.
-grep "rm:.*$destdir" output || fatal_ "expected code path not covered"
+grep "rm:.*$destdir" stderr || fatal_ "expected code path not covered"
 
 :
index 8c789001e119e847288674982788661975dd0eff..fb8e4054ae707d6cf2da634e6fcf60b4f031f16c 100755 (executable)
@@ -54,11 +54,11 @@ $MAKE uninstall
 test -f inst/share/dir
 rm -rf inst
 
-$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 
-$FGREP 'ERROR: files left after uninstall:' output
-grep '/share/dir *$' output
+grep 'ERROR: files left after uninstall:' stderr
+grep '/share/dir *$' stderr
 
 # A few trickier corner cases.
 
@@ -86,11 +86,11 @@ test -f inst/mu/share/info/dir
 test -f inst/share/info/more/dir
 rm -rf inst
 
-$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 
-$FGREP 'ERROR: files left after uninstall:' output
-grep '/mu/share/info/dir *$' output
-grep '/share/info/more/dir *$' output
+grep 'ERROR: files left after uninstall:' stderr
+grep '/mu/share/info/dir *$' stderr
+grep '/share/info/more/dir *$' stderr
 
 :
index a1531d355f98e52e74acc01e6e3340ba33bf2b05..b22245aee3ef4f00d02632c854498b1f00094e0f 100755 (executable)
@@ -84,9 +84,9 @@ find _inst | $EGREP '\.elc?$' && Exit 1
 unique=0a3346e2af8a689b85002b53df09142a
 $sleep
 echo "(message \"$unique\")(provide 'am-three)" > am-three.el
-$MAKE >output 2>&1 || { cat output; Exit 1; }
-cat output
-grep $unique output
+$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep $unique stderr
 
 # It should also work for VPATH-builds.
 $MAKE distcheck
index fbec0fd0c163712001ec45f1aa7efad8acea276e..1547962e6e89c5b10934490b59596af8813529c2 100755 (executable)
@@ -38,21 +38,21 @@ $AUTOMAKE -a
 
 ./configure
 
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE check >stdout 2>stderr && { cat stdout; cat stderr >&2; Exit 1; }
+cat stdout; cat stderr >&2
 test -f ok.log
-grep '^PASS: ok\.test' output
-$FGREP 'zardoz.log' output
+grep '^PASS: ok\.test' stdout
+$FGREP 'zardoz.log' stderr
 test ! -f test-suite.log
 
-$MAKE TESTS='zardoz2.test' check >output 2>&1 && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz2.log' output
+$MAKE TESTS='zardoz2.test' check 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr
+$FGREP 'zardoz2.log' stderr
 test ! -f test-suite.log
 
-$MAKE TEST_LOGS='zardoz3.log' check >output 2>&1 && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz3.log' output
+$MAKE TEST_LOGS='zardoz3.log' check 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$FGREP 'zardoz3.log' stderr
 test ! -f test-suite.log
 
 # The errors should persist even after 'test-suite.log'
@@ -62,9 +62,9 @@ test ! -f test-suite.log
 $MAKE check
 rm -f zardoz.test
 
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz.log' output
+$MAKE check 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$FGREP 'zardoz.log' stderr
 test ! -f test-suite.log
 
 :
index e511a8b4edf760904d75d7ea803f085f73c39fb0..dadc1b043ea01cc523d03f3718b7cc392df2a401 100755 (executable)
@@ -43,12 +43,12 @@ test ! -f foobar1.trs || Exit 99
 test ! -f foobar2.log || Exit 99
 test ! -f foobar2.trs || Exit 99
 
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-grep 'test-suite\.log.*foobar1\.log' output
-grep 'test-suite\.log.*foobar1\.trs' output
-grep 'test-suite\.log.*foobar2\.log' output
-grep 'test-suite\.log.*foobar2\.trs' output
+$MAKE check 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'test-suite\.log.*foobar1\.log' stderr
+grep 'test-suite\.log.*foobar1\.trs' stderr
+grep 'test-suite\.log.*foobar2\.log' stderr
+grep 'test-suite\.log.*foobar2\.trs' stderr
 test ! -f test-suite.log
 
 :
index aee1fb5b723900ab3dc34faa87b9a4e12ab2d0f3..a1897b1d4a6a7feb8194e4f00156a90155186b17 100755 (executable)
@@ -61,19 +61,19 @@ mkdir $inst $inst/share
 : > $inst/share/foobar.txt
 
 chmod a-w $inst/share
-$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE uninstall 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 if test $rm_f_is_silent_on_error = yes; then
   : "rm -f" is silent on errors, skip the grepping of make output
 else
-  grep "rm: .*foobar\.txt" output
+  grep "rm: .*foobar\.txt" stderr >&2
 fi
 
 chmod a-rwx $inst/share
 (cd $inst/share) && skip_ "cannot make directories fully unreadable"
 
-$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
-cat output
+$MAKE uninstall 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 #
 # Some shells, like Solaris 10 /bin/sh and /bin/ksh, do not report
 # the name of the 'cd' builtin upon a chdir error:
@@ -91,6 +91,6 @@ cat output
 #   > cd unreadable'
 #   /usr/xpg4/bin/sh[3]: unreadable: permission denied
 #
-$EGREP "(cd|sh)(\[[0-9]*[0-9]\])?: .*$inst/share" output
+$EGREP "(cd|sh)(\[[0-9]*[0-9]\])?: .*$inst/share" stderr
 
 :
index 6f02f1109d3193bced0d5e3066bf73e2d0a820ac..814b3d28f0a6c9dba2e81b1dcb90614d7b3c72e1 100755 (executable)
@@ -83,8 +83,8 @@ chmod a-w $distdir
 mkdir build2
 cd build2
 ../$distdir/configure
-$MAKE >out 2>&1 && { cat out; Exit 1; }
-cat out
-$FGREP parse.c out
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$FGREP parse.c stderr
 
 :