]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] tests: "make -k" can be trusted with GNU make
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 21 Feb 2012 15:22:45 +0000 (16:22 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 21 Feb 2012 15:23:22 +0000 (16:23 +0100)
* tests/check12.test: Trust exit status of "make -k".
* tests/check4.test: Likewise.
* tests/gnits2.test: Likewise.
* tests/gnits3.test: Likewise.
* tests/make-dryrun.tap: Likewise.
* tests/distlinksbrk.test: Trust that "make -k" really doesn't exit
at the first error, and prints error messages to stderr.  Related
simplifications and reorganization.

tests/check12.test
tests/check4.test
tests/distlinksbrk.test
tests/gnits2.test
tests/gnits3.test

index 1afa95982447568129ff89ef31868213aae52abd..c4440ea1f5687d0489a3911b497823dfa530cabc 100755 (executable)
@@ -183,8 +183,8 @@ for vpath in : false; do
   CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
   grep 'check-local failed :-(' local.log
 
-  # Do not trust the exit status of `make -k'.
-  NAIL=screw B_EXIT_STATUS=23 CHECKLOCAL_EXIT_STATUS=1 $MAKE -k check || :
+  env NAIL=screw B_EXIT_STATUS=23 CHECKLOCAL_EXIT_STATUS=1 \
+      $MAKE -k check && Exit 1
   test -f hammer.log
   test -f hammer.sum
   test -f spanner.log
index 7edfa5a4a01fbd6edf861f017e8f6201a46348da..f4dc5923d073a5d73153762b5846b0a12c1970fc 100755 (executable)
@@ -55,15 +55,13 @@ cat stdout
 grep '^FAIL: fail\.sh *$' stdout
 grep '^PASS: ok\.sh *$' stdout && Exit 1
 
-# The exit status of `make -k' can be anything
-# (depending on the Make implementation)
-$MAKE -k check >stdout || :
+$MAKE -k check >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep '^FAIL: fail\.sh *$' stdout
 grep '^PASS: ok\.sh *$' stdout
 
 # Should also works when -k is not in first position.
-$MAKE -s -k check >stdout || :
+$MAKE -s -k check >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep '^FAIL: fail\.sh *' stdout
 grep '^PASS: ok\.sh *' stdout
@@ -71,7 +69,7 @@ grep '^PASS: ok\.sh *' stdout
 # Try with a long-option that do not have a short option equivalent
 # (here, --no-print-directory).  That should cause all options to
 # appear verbatim in MAKEFLAGS.
-$MAKE --no-print-directory -k check >stdout || :
+$MAKE --no-print-directory -k check >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep '^FAIL: fail\.sh *$' stdout
 grep '^PASS: ok\.sh *$' stdout
index 8dcd81e1e7409b41b34a5bae753379689ae5b250..7d1926b2f9bfabf9d3a10855e382d23242781ac1 100755 (executable)
@@ -48,21 +48,26 @@ cat >> configure.in <<'END'
 AC_OUTPUT
 END
 
+cat > Makefile.am <<END
+EXTRA_DIST = $lnk1 $lnk2 $lnka $lnkb
+END
+
 $ACLOCAL
 $AUTOCONF
+$AUTOMAKE
+./configure
 
 ls -l # For debugging.
 
-# Don't try to use "make -k", because some botched make implementations
-# (HP-UX, IRIX) might still exit on the first error in this situations.
-for lnk in $lnk1 $lnk2 $lnka $lnkb; do
-  echo "EXTRA_DIST = $lnk" > Makefile.am
-  $AUTOMAKE
-  ./configure
-  # Distribution must fail, with a decent error message.
-  $MAKE distdir >out 2>&1 && { cat out; Exit 1; }
-  cat out
-  $FGREP $lnk out
-done
+# Distribution must fail.
+$MAKE distdir && Exit 1
+
+# Names of distributed broken symlinks should be reported in make output.
+$MAKE -k distdir 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$FGREP $lnk1 stderr
+$FGREP $lnk2 stderr
+$FGREP $lnka stderr
+$FGREP $lnkb stderr
 
 :
index d65586fffbadcf50249c2f73072be9ee6eade94f..97028f2c15d2ba1e16f8d023b61ea33dedd2b017 100755 (executable)
@@ -107,7 +107,7 @@ cd build
 ../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
 $MAKE all
 $MAKE test-install
-$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
+$MAKE -k installcheck 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $MAKE grep-stderr
 
index 17ab6f06d8dd04001a717c61a12cd92ab9de21ec..35c2b0cbb852cce7deab87b9e1e1f8411e7821ed 100755 (executable)
@@ -87,7 +87,7 @@ cd build
 $MAKE
 $MAKE install
 $MAKE installcheck && Exit 1
-$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
+$MAKE -k installcheck 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $MAKE grep-stderr