From: Stefano Lattarini Date: Tue, 21 Feb 2012 15:22:45 +0000 (+0100) Subject: [ng] tests: "make -k" can be trusted with GNU make X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfdfdaa87da4f0549b13538aca50464904b160c4;p=thirdparty%2Fautomake.git [ng] tests: "make -k" can be trusted with GNU make * 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. --- diff --git a/tests/check12.test b/tests/check12.test index 1afa95982..c4440ea1f 100755 --- a/tests/check12.test +++ b/tests/check12.test @@ -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 diff --git a/tests/check4.test b/tests/check4.test index 7edfa5a4a..f4dc5923d 100755 --- a/tests/check4.test +++ b/tests/check4.test @@ -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 diff --git a/tests/distlinksbrk.test b/tests/distlinksbrk.test index 8dcd81e1e..7d1926b2f 100755 --- a/tests/distlinksbrk.test +++ b/tests/distlinksbrk.test @@ -48,21 +48,26 @@ cat >> configure.in <<'END' AC_OUTPUT END +cat > Makefile.am < 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 : diff --git a/tests/gnits2.test b/tests/gnits2.test index d65586fff..97028f2c1 100755 --- a/tests/gnits2.test +++ b/tests/gnits2.test @@ -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 diff --git a/tests/gnits3.test b/tests/gnits3.test index 17ab6f06d..35c2b0cbb 100755 --- a/tests/gnits3.test +++ b/tests/gnits3.test @@ -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