tests: avoid use of redirected 'run_make' invocations
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 22 May 2013 21:29:47 +0000 (23:29 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 22 May 2013 21:59:56 +0000 (23:59 +0200)
Instead, properly use the -E, -O, or -M options of run_make.
The occurrences of the 'run_make' invocations using output
redirection has been found by the recently-introduced maintainer
check 'sc_tests_no_run_make_redirect'.

* t/ax/tap-summary-aux.sh: Adjust.
* t/ax/testsuite-summary-checks.sh: Likewise.
* Several other tests: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
51 files changed:
t/ax/tap-summary-aux.sh
t/ax/testsuite-summary-checks.sh
t/check11.sh
t/check5.sh
t/check7.sh
t/color-tests.sh
t/distdir.sh
t/exeext.sh
t/libtool9.sh
t/parallel-tests-basics.sh
t/parallel-tests-cmdline-override.sh
t/parallel-tests-exit-statuses.sh
t/parallel-tests-extra-programs.sh
t/parallel-tests-fork-bomb.sh
t/parallel-tests-log-override-2.sh
t/parallel-tests-log-override-recheck.sh
t/subst-no-trailing-empty-line.sh
t/tap-autonumber.sh
t/tap-bailout-leading-space.sh
t/tap-bailout-suppress-later-errors.sh
t/tap-bailout.sh
t/tap-basic.sh
t/tap-color.sh
t/tap-diagnostic.sh
t/tap-doc2.sh
t/tap-global-result.sh
t/tap-merge-stdout-stderr.sh
t/tap-msg0-bailout.sh
t/tap-msg0-planskip.sh
t/tap-out-of-order.sh
t/tap-plan-corner.sh
t/tap-plan-leading-zero.sh
t/tap-plan-malformed.sh
t/tap-plan-middle.sh
t/tap-plan-whitespace.sh
t/tap-plan.sh
t/tap-planskip-and-logging.sh
t/tap-planskip-case-insensitive.sh
t/tap-planskip-late.sh
t/tap-planskip-unplanned-corner.sh
t/tap-planskip-whitespace.sh
t/tap-planskip.sh
t/tap-recheck-logs.sh
t/tap-test-number-0.sh
t/tap-unplanned.sh
t/test-driver-custom-multitest-recheck2.sh
t/test-driver-custom-multitest.sh
t/test-missing.sh
t/test-trs-recover.sh
t/test-trs-recover2.sh
t/testsuite-summary-reference-log.sh

index 2270079306cfd755891c0aad1cc5a49f2c75024b..472c43f4b52cbe04cdb4c9e1ca525ce5c23eeacb 100644 (file)
@@ -53,7 +53,6 @@ do_check ()
   shift
   cat > summary.exp
   cat all.test
-  st=0
   if test $use_colors = yes; then
     # Forced colorization should take place also with non-ANSI terminals;
     # hence the "TERM=dumb" definition.
@@ -61,12 +60,11 @@ do_check ()
   else
     make_args=
   fi
-  run_make $make_args check > stdout || st=$?
-  cat stdout
+  run_make -O -e IGNORE $make_args check
   if test $expect_failure = yes; then
-    test $st -gt 0 || exit 1
+    test $am_make_rc_got -gt 0 || exit 1
   else
-    test $st -eq 0 || exit 1
+    test $am_make_rc_got -eq 0 || exit 1
   fi
   $PERL "$am_testaux_srcdir"/extract-testsuite-summary.pl stdout >summary.got \
     || fatal_ "cannot extract testsuite summary"
index 94de72d7878aedb31ba2053286b5083c522c31cf..1b37134b95e2ab348493ac12119ae7206ec7670c 100644 (file)
@@ -74,8 +74,7 @@ do_check ()
     case $t in fail*|xpass*|error*) expect_failure=:;; esac
     case $t in xfail*|xpass*) xfail_tests="$xfail_tests $t";; esac
   done
-  run_make -e IGNORE check TESTS="$tests" XFAIL_TESTS="$xfail_tests" >stdout
-  cat stdout
+  run_make -O -e IGNORE check TESTS="$tests" XFAIL_TESTS="$xfail_tests"
   if $expect_failure; then
     test $am_make_rc_got -gt 0 || exit 1
   else
index 3526d84a73f0288a1af9054a5303c6c0cc478489..6be5aad1ca3c963810f82b68d0927593248361ae 100644 (file)
@@ -40,8 +40,7 @@ $AUTOMAKE -a
 
 ./configure
 
-run_make TESTS=skip check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O TESTS=skip check
 if test x"$am_serial_tests" = x"yes"; then
   grep '1.*passed' stdout && exit 1
   : For shells with buggy 'set -e'.
@@ -49,8 +48,7 @@ else
   count_test_results total=1 pass=0 fail=0 skip=1 xfail=0 xpass=0 error=0
 fi
 
-run_make TESTS="skip skip2" check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O TESTS="skip skip2" check
 if test x"$am_serial_tests" = x"yes"; then
   grep '2.*passed' stdout && exit 1
   : For shells with buggy 'set -e'.
index a70883919c8c1333d46173dbf4e01ac80dfaeaca..738b3a1305e43199b34851b46cc2eec98822f8bc 100644 (file)
@@ -52,8 +52,7 @@ cp one.c two.c
 ./configure
 $MAKE check
 test -f ok
-run_make EXEEXT=.bin print-tests >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O EXEEXT=.bin print-tests
 $FGREP 'BEG: one.bin two.bin :END' stdout
 # No am__EXEEXT_* variable is needed.
 grep '_EXEEXT_[1-9]' Makefile.in && exit 1
index 5575f953f90381a351707dc2c2516d3454b8b8b1..1dd918bb1421eda1a5cfbe3e37352eed21bfa1ca 100644 (file)
@@ -60,8 +60,7 @@ $AUTOMAKE -a
 
 ./configure
 $MAKE check
-run_make EXEEXT=.bin print-xfail-tests >stdout || {  cat stdout; exit 1; }
-cat stdout
+run_make -O EXEEXT=.bin print-xfail-tests
 $FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
 
 $MAKE distcheck
index 9a0d4351f7966a5659a69615772f6cda2af34a74..3ddef994aac0c68a9d5bae62a2db46f8a7cf53ae 100644 (file)
@@ -135,13 +135,11 @@ for vpath in false :; do
   # Forced colorization should take place also with non-ANSI terminals;
   # hence the "TERM=dumb" definition.
   AM_COLOR_TESTS=always; export AM_COLOR_TESTS
-  run_make TERM=dumb check >stdout && { cat stdout; exit 1; }
-  cat stdout
+  run_make -e FAIL -O TERM=dumb check
   test_color
 
   unset AM_COLOR_TESTS
-  run_make TERM=ansi check >stdout && { cat stdout; exit 1; }
-  cat stdout
+  run_make -e FAIL -O TERM=ansi check
   test_no_color
 
   $MAKE distclean
index 94de0d2af4574526d305a02603f7f525a3ce34eb..4d1410d6d3a6ba17f2a2dce1f6982271b2e143c0 100644 (file)
@@ -68,8 +68,7 @@ test -d foo && exit 1
 
 rm -rf $me-1.0
 # Remove the dot from VERSION for the next grep.
-run_make -e IGNORE VERSION=10 MKDIR_P='echo MKDIR_P' distdir >stdout
-cat stdout
+run_make -O -e IGNORE VERSION=10 MKDIR_P='echo MKDIR_P' distdir
 
 # Make sure no './' appear in the directory names.  srcdir is '..', so
 # this also checks that no directory is created in the source tree.
index 604e9a5fe37712672ab922ee392a42459c2800ff..72902333ee4e45c4f30cb7add94e228e2d9e600a 100644 (file)
@@ -69,8 +69,7 @@ grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
 
 ./configure
 
-run_make EXEEXT=.foo print > stdout
-cat stdout
+run_make -O EXEEXT=.foo print
 
 grep '1BEG: maude.foo mt.foo :END1' stdout
 grep '2BEG: maude.static.foo :END2' stdout
@@ -79,8 +78,7 @@ grep '4BEG: rmt.foo :END4' stdout
 
 ./configure revert=yes
 
-run_make EXEEXT=.foo print > stdout
-cat stdout
+run_make -O EXEEXT=.foo print
 
 grep '1BEG: maude.foo :END1' stdout
 grep '2BEG: maude.static.foo :END2' stdout
index 9ab4d976ae1c68b287b2dfa0c6eac3a4c2fc3ce6..7a613dc779bad3155d288740198d6ca296231931 100644 (file)
@@ -85,15 +85,14 @@ $AUTOCONF
 $AUTOMAKE --add-missing --copy
 
 ./configure
-run_make \
+run_make -M -- print \
   LDFLAGS=ldflags \
   AM_LDFLAGS=am_ldflags \
   libmod1_la_LDFLAGS=lm1_la_ldflags \
   CFLAGS=cflags \
   AM_CFLAGS=am_cflags \
-  prg2_CFLAGS=prg2_cflags \
-  print >output 2>&1 || { cat output; exit 1; }
-cat output
+  prg2_CFLAGS=prg2_cflags
+
 grep '1BEG: libmod1.la mod2.la :END1' output
 grep '2BEG: mod2.la :END2' output
 grep '3BEG:.* am_cflags cflags .*lm1_la_ldflags ldflags.* :END3' output
@@ -102,6 +101,7 @@ grep '4BEG: :END4' output
 grep '5BEG: :END5' output
 grep '6BEG:.* prg2_cflags cflags .*am_ldflags ldflags.* :END6' output
 grep '6BEG: .*am_cflags.* :END6' output && exit 1
+
 $MAKE
 
 :
index 4d0fe95025afc2257a1cb704eeef67bdcfcca3c8..dbd7ac8a0e92f87a2a64236cab1db05f44f10b16 100644 (file)
@@ -87,8 +87,7 @@ test ! -e test-suite.log
 # Note that this usage has a problem: the summary will only
 # take bar.log into account, because the $(TEST_SUITE_LOG) rule
 # does not "see" baz.log.  Hmm.
-run_make TESTS='bar.test' check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS='bar.test' check
 grep '^FAIL: baz\.test$' stdout
 grep '^ERROR: bar\.test$' stdout
 
@@ -103,8 +102,7 @@ test -f test-suite.log
 # Note that the previous test and this one taken together expose the timing
 # issue that requires the check-TESTS rule to always remove TEST_SUITE_LOG
 # before running the tests lazily.
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 test -f foo.log
 grep '^PASS: foo\.test$' stdout
 grep bar.test stdout && exit 1
@@ -115,8 +113,7 @@ grep '^# ERROR: *1$' stdout
 
 # Now, explicitly retry with all test logs already updated, and ensure
 # that the summary is still displayed.
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
 grep baz.test stdout && exit 1
@@ -125,8 +122,7 @@ grep '^# FAIL: *1$' stdout
 grep '^# ERROR: *1$' stdout
 
 # Lazily rerunning only foo should only rerun this one test.
-run_make RECHECK_LOGS=foo.log check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=foo.log
 grep foo.test stdout
 grep bar.test stdout && exit 1
 grep baz.test stdout && exit 1
@@ -135,15 +131,13 @@ grep '^# FAIL: *1$' stdout
 grep '^# ERROR: *1$' stdout
 
 $MAKE clean
-run_make TEST_LOGS=baz.log check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TEST_LOGS=baz.log check
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
 grep baz.test stdout
 
 $MAKE clean
-run_make TESTS=baz.test check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS=baz.test check
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
 grep baz.test stdout
index ef78c2632fc4e89885a8107d15493ff69b0f5cd3..d4d9abcb8ed49f2b30c10be45b37c41ecb7ee9fe 100644 (file)
@@ -60,8 +60,7 @@ END
 
 do_check ()
 {
-  run_make "$@" check >stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O -- "$@" check
   grep '^PASS:' stdout | LC_ALL=C sort > got-out
   cat got-out
   ls . | grep '\.log$' | LC_ALL=C sort > got-log
index a2d181c2d05eb48604cef89d0d7b7c9a340b5137..54181e2cf57802c3bd82d4b656619e686c9de768 100644 (file)
@@ -73,8 +73,7 @@ mk_ ()
 {
   n=$1; shift
   unset am_make_rc_got
-  run_make -e IGNORE ${1+"$@"} check > stdout
-  cat stdout
+  run_make -e IGNORE -O -- ${1+"$@"} check
   cat test-suite.log
   LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-$n
   cat exp-$n
index b8d7a99de21364f371a4890f1d33e6a4491b9663..03800a88d626218184d6554e07ef6d7bc129f53c 100644 (file)
@@ -158,8 +158,7 @@ $sleep
 
 echo 'int main (void) { return 0; }' > none.c
 
-run_make -e IGNORE RECHECK_LOGS= check >stdout
-cat stdout
+run_make -O -e IGNORE check RECHECK_LOGS=
 ls -l # For debugging.
 test $am_make_rc_got -eq 0 || exit 1
 
index e63c0d7603a9676b9e2370cad0429a48991b3632..1361bbd190c27dd2d6afd82553124a7428efe30d 100644 (file)
@@ -98,16 +98,14 @@ $AUTOMAKE -a -Wno-portability
 
 do_check ()
 {
-  st=0
   log=$1; shift
-  run_make "$@" check >output 2>&1 || st=$?
-  cat output
+  run_make -M -e IGNORE -- "$@" check
   $FGREP '::OOPS::' output && exit 1 # Possible infinite recursion.
   # Check that at least we don't create a botched global log file.
   test ! -e "$log"
   if using_gmake; then
     grep "[Cc]ircular.*dependency" output | $FGREP "$log"
-    test $st -gt 0
+    test $am_make_rc_got -gt 0
   else
     # Look for possible error messages about circular dependencies from
     # either make or our own recipes.  At least one such a message must
index 54e2ed92412e17b02171fe4fe6c6d5810207003c..b08f7560e01638d680338f00242b7c415e14e404 100644 (file)
@@ -60,9 +60,7 @@ for test_list_override in \
   'TESTS=pass.test skip.test' \
   'TEST_LOGS=pass.log skip.log'
 do
-  run_make TEST_SUITE_LOG=partial.log "$test_list_override" check >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TEST_SUITE_LOG=partial.log "$test_list_override" check
   ls -l
   count_test_results total=2 pass=1 fail=0 skip=1 xfail=0 xpass=0 error=0
   cat pass.log
index ff6f58262f1fada27d9201b76c540b7f0493d3fd..2bfac7f65f6f8e6e5eb00485c8ab80722ecdf5d2 100644 (file)
@@ -67,9 +67,7 @@ cat stdout
 using_gmake || $sleep # Required by BSD make.
 
 chmod a-rw test-suite.log
-run_make TEST_SUITE_LOG=my.log recheck >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TEST_SUITE_LOG=my.log recheck
 ls -l
 filter_stdout
 count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1
@@ -82,9 +80,7 @@ done
 using_gmake || $sleep # Required by BSD make.
 
 chmod a-rw my.log
-run_make BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log recheck >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log recheck
 ls -l
 count_test_results total=2 pass=1 fail=0 skip=0 xfail=0 xpass=0 error=1
 filter_stdout
index 3fcb1b7ace12ed3115d2d76936f0a1732949e860..5097f5fa436f8b5557ba2265ce6087991dff8a51 100644 (file)
@@ -82,14 +82,12 @@ test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
 cat t-programs
 grep '^ *$' t-programs && exit 1
 
-run_make print-programs >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O print-programs
 grep '^BEG1: x :END1$' stdout
 grep '^BEG2: :END2$' stdout
 grep '^BEG3: zardoz x :END3$' stdout
 
-run_make am__empty=X print-programs >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O am__empty=X print-programs
 grep '^BEG1: x X :END1$' stdout
 grep '^BEG2: X :END2$' stdout
 grep '^BEG3: zardoz x X :END3$' stdout
index f1820ce86d25e00e5e8bac91dbd8dc4f079c0318..d89aa789f2053f30f287d12f6116aeb75b5105aa 100644 (file)
@@ -44,8 +44,7 @@ not ok
 ok
 END
 
-run_make TESTS=all.test check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS=all.test check
 count_test_results total=14 pass=6 fail=5 xpass=1 xfail=1 skip=1 error=0
 
 cat > exp <<'END'
index c84c612425d958244f40e2ddc4b85893a93ba855..120ae03404c5d8e82ed01e9111dc783f179b5e22 100644 (file)
@@ -50,10 +50,7 @@ ERROR: b.test - Bail out!
 ERROR: c.test - Bail out! FUBAR!
 END
 
-run_make TESTS='a.test b.test c.test' check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='a.test b.test c.test' check
 count_test_results total=5 pass=1 fail=0 xpass=0 xfail=0 skip=1 error=3
 
 LC_ALL=C sort exp > t
index 7f602942c3eaf789b99df86565506c9455e07c1b..365e8945af93e83bc1ea78787e1b482687c54020 100644 (file)
@@ -52,10 +52,7 @@ ok 2
 ok 3
 END
 
-run_make TESTS='foo.test bar.test baz.test' check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
-
+run_make -e FAIL -O TESTS='foo.test bar.test baz.test' check
 count_test_results total=5 pass=1 fail=0 xpass=0 xfail=0 skip=1 error=3
 
 grep '^ERROR: foo\.test - Bail out!$' stdout
index b6c0f56d129e8a89dd5f0dd79141fa69c0db61fc..94100f4c12899a79b748e04f0d19689dc00de0da 100644 (file)
@@ -118,10 +118,7 @@ echo "ERROR: e.test - Bail out!" >> exp
 # Doing the sums above, we have:
 test_counts='total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5'
 
-run_make TESTS='a.test b.test c.test d.test e.test' check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='a.test b.test c.test d.test e.test' check
 count_test_results $test_counts
 
 LC_ALL=C sort exp > t
index 5e4462b26a3cbcd406b3f1404dfc0533c4360d5b..c146088a26308a6f6ad047ad46127a27509747e4 100644 (file)
@@ -127,9 +127,7 @@ Bail out!
 ok 1
 END
 
-run_make check TESTS=bail.test >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check TESTS=bail.test
 count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
 
 test ! -e success.log
@@ -146,9 +144,7 @@ $FGREP 'success.test' stdout && exit 1
 
 rm -f *.log *.test
 
-run_make check TEST_LOGS=ok.log >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check TEST_LOGS=ok.log
 count_test_results total=3 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=0
 
 test -f ok.test
index 997cb796592a50e53e91525047098c37f8412641..409663ebcc50c96ff76d87f5da26d397affde3b7 100644 (file)
@@ -153,13 +153,11 @@ test_no_color ()
 # Forced colorization should take place also with non-ANSI terminals;
 # hence the "TERM=dumb" definition.
 AM_COLOR_TESTS=always; export AM_COLOR_TESTS
-run_make TERM=dumb check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TERM=dumb check
 test_color
 
 unset AM_COLOR_TESTS
-run_make TERM=ansi check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TERM=ansi check
 test_no_color
 
 :
index 59b1bda41d501ab1e3cfc248f1db6944c5303211..96b2a3dd310c83e73776b5a45217aebf69affcc1 100644 (file)
@@ -66,9 +66,7 @@ cat got
 diff exp got
 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
 
-run_make TEST_LOG_DRIVER_FLAGS="--no-comments" check >stdout \
-  || { cat stdout; exit 1; }
-cat stdout
+run_make -O TEST_LOG_DRIVER_FLAGS="--no-comments" check
 $EGREP -i "#.*all\\.test|a comment|(Tests|Shell) " stdout && exit 1
 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
 
index 55c734bd86b676584cfb99497491f27cf1cfb37f..742ae5ede2ef24ca57ba8213cb15918b75207a2a 100644 (file)
@@ -106,10 +106,9 @@ diff exp got
 
 grep '^Please report to bug-automake@gnu\.org$' stdout
 
-run_make >stdout check \
+run_make -O check \
   TESTS='foo.test baz.test' \
-  TEST_LOG_DRIVER_FLAGS='--comments --ignore-exit' \
-  || { cat stdout; exit 1; }
+  TEST_LOG_DRIVER_FLAGS='--comments --ignore-exit'
 
 cat > exp <<'END'
 PASS: foo.test 1 - Swallows fly
index a4a1fd1615a90eceee1bba8fc8ce4423d5ac4e7f..025d784980082bfdc7850e34903902c6f452b8b4 100644 (file)
@@ -140,8 +140,7 @@ END
 
 tests=$(echo *.test) # Also required later.
 
-run_make TESTS="$tests" check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS="$tests" check
 
 # Dirty trick required here.
 for tst in $(echo " $tests " | sed 's/\.test / /'); do
index ef99d8204f4993bf032fcae7095aad3893fe3d31..74f6f2e785aa52a4fae108a8a88ac9fdf8efe87e 100644 (file)
@@ -60,10 +60,7 @@ count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
 
 # See that the option '--no-merge' can override the effect of '--merge'.
 
-run_make TEST_LOG_DRIVER_FLAGS=--no-merge check >stdout \
-  || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TEST_LOG_DRIVER_FLAGS=--no-merge check
 count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
 
 
index 9e2bdcedff705fba213a55d9da75f69e9d793ba0..c6b3ca5e279f5611e2a3a6ead5e2a9fe5e483f0c 100644 (file)
@@ -26,9 +26,7 @@
 echo 'Bail out! 0' > a.test
 echo 'Bail out! 0.0' > b.test
 
-run_make TESTS='a.test b.test' check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='a.test b.test' check
 count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=2
 
 grep '^ERROR: a.test - Bail out! 0$' stdout
index 3c6252d77a2a05bdf23bacab2273bf814f65f862..71e882e71ea4e3b21dbcc69765284afb9f83b286 100644 (file)
@@ -25,9 +25,7 @@
 echo '1..0 # SKIP 0' > a.test
 echo '1..0 # SKIP 0.0' > b.test
 
-run_make TESTS='a.test b.test' check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS='a.test b.test' check
 count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
 
 grep '^SKIP: a.test - 0$' stdout
index bac7acdb576edd1c7f99cd79b8d0f94c81db7030..bb26edde4cb95e748e7e8337126caeccdfaa3453 100644 (file)
@@ -57,10 +57,7 @@ ok 16
 ok 17
 END
 
-run_make TESTS='a.test b.test c.test d.test' check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='a.test b.test c.test d.test' check
 count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
 
 test $($FGREP -c ': a.test' stdout) -eq 3
index 27f41fdbc269992edb2c9a16016977cc62ea7224..7b64d3efd2fb79bae2d412c83b17394dd0542423 100644 (file)
@@ -36,9 +36,7 @@ ok 1
 END
 
 for pos in leading trailing; do
-  run_make TESTS="$pos-repeated.test" check >stdout \
-    && { cat stdout; exit 1; }
-  cat stdout
+  run_make -O -e FAIL TESTS="$pos-repeated.test" check
   count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
   grep "^ERROR: $pos-repeated\\.test - multiple test plans$" stdout
 done
@@ -59,9 +57,8 @@ ok 2
 1..2
 END
 
-run_make TESTS="leading-repeated.test trailing-repeated.test" check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check \
+  TESTS='leading-repeated.test trailing-repeated.test'
 count_test_results total=6 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=3
 grep "^ERROR: leading-repeated\\.test - multiple test plans$" stdout
 grep "^ERROR: trailing-repeated\\.test - multiple test plans$" stdout
@@ -90,9 +87,7 @@ cat > 4.test <<END
 1..0 # SKIP
 END
 
-run_make TESTS="1.test 2.test 3.test 4.test" check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check TESTS='1.test 2.test 3.test 4.test'
 count_test_results total=8 pass=0 fail=0 xpass=0 xfail=0 skip=4 error=4
 for i in 1 2 3 4; do
   grep "^ERROR: $i\\.test - multiple test plans$" stdout
@@ -112,8 +107,7 @@ ok 4
 ok 5
 END
 
-run_make check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
 count_test_results total=8 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=3
 
 cat > exp <<'END'
@@ -143,8 +137,7 @@ ok 2
 ok 3
 END
 
-run_make check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
 count_test_results total=5 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=3
 
 cat > exp <<'END'
@@ -174,8 +167,7 @@ ok 4
 ok 5
 END
 
-run_make check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
 count_test_results total=7 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=4
 
 cat > exp <<'END'
index 00caeb4599126eca40f18aacb644d383533eb990..92f43e4f8ee7e586709a4034175c64c5d1b6c029 100644 (file)
@@ -47,10 +47,7 @@ done >> d.test
 echo 1..00 > e.test
 echo '1..000 # SKIP' > f.test
 
-run_make TESTS='a.test b.test c.test d.test e.test f.test' check >stdout \
-  || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS='a.test b.test c.test d.test e.test f.test' check
 count_test_results total=115 pass=113 xfail=0 skip=2 fail=0 xpass=0 error=0
 
 :
index e2dd7d02c32ddceca7eaca28d584d49201156f44..82da56984ba598ef09934fb61cf795ca01e156f8 100644 (file)
@@ -47,9 +47,7 @@ END
 
 tests_list=$(echo *.test)
 
-run_make TESTS="$tests_list" check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS="$tests_list" check
 count_test_results total=9 pass=2 fail=0 xpass=0 xfail=2 skip=0 error=5
 
 for tst in $tests_list; do
index bfc473b3fba6e2a1af2d63def42aa7c5fdd1b068..dd3247bbda66a145fcbbb0158852a2aa21b42786 100644 (file)
@@ -73,9 +73,7 @@ END
 tests=$(echo *.test)
 
 for tap_flags in "" "--comments"; do
-  run_make TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" check >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" check
   count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
 done
 
index 659a7e77a9f437cc058f30d5f3f4f7ded528d935..a3e2137b94780995ddfa9eba79d524a12765effc 100644 (file)
@@ -32,9 +32,7 @@ cat > bar.test <<END
 ok 1
 END
 
-run_make TESTS='foo.test bar.test' check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS='foo.test bar.test' check
 count_test_results total=3 pass=3 fail=0 error=0 xpass=0 xfail=0 skip=0
 
 :
index 50ae426052c8c35e8ebbf667e68ae4e6052bcf2c..f17d90474af06e6509eba24ed4514bfdc4b0113d 100644 (file)
@@ -41,9 +41,9 @@ ok
 END
 
 for tap_flags in "" "--comments"; do
-  run_make TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS='top.test bot.test' \
-    check >stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O check \
+    TESTS='top.test bot.test' \
+    TEST_LOG_DRIVER_FLAGS="$tap_flags"
   count_test_results total=7 pass=5 xfail=1 skip=1 fail=0 xpass=0 error=0
 done
 
index b3089e41ac09c83af98690f66ed98d00760a5756..aaea4d0ab755b183794466cf554b35e9f000a815 100644 (file)
@@ -45,10 +45,7 @@ an early non-TAP line
 a later non-TAP line
 END
 
-run_make TESTS='foo.test foo2.test bar.test' check >stdout \
-  || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS='foo.test foo2.test bar.test' check
 count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=3 error=0
 
 grep '^# foo\.test: a comment$' stdout
index 54a644e52b782d6042bdcc7ca9316146fea4d440..790d9846d49f0927d21bf332039b8f0eb9a9010f 100644 (file)
@@ -32,9 +32,7 @@ for c4 in p P; do
   echo "1..0 # $c1$c2$c3$c4 foobar" > $j.test
 done; done; done; done
 
-run_make TESTS="$(echo *.test)" check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS="$(echo *.test)" check
 count_test_results total=16 pass=0 fail=0 xpass=0 xfail=0 skip=16 error=0
 
 for tst in *.test; do
index ab3f336f56760cadf7dca492b55538d7b5b7ff05..94af3e82bd430f13c8737abeaebfa94dad00a7f9 100644 (file)
@@ -32,8 +32,7 @@ cat > bar.test <<END
 1..0
 END
 
-run_make TESTS='foo.test bar.test' check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O TESTS='foo.test bar.test' check
 
 grep '^SKIP: foo\.test .* from the last line$' stdout
 grep '^SKIP: bar\.test$' stdout
index 21764699534f23472d4965fffc20264eb628454b..36473b3866fa8e39a4ba918dd2542fcfc77fa5d1 100644 (file)
@@ -32,9 +32,7 @@ ok 1 # SKIP
 1..0 # SKIP
 END
 
-run_make TESTS='foo.test bar.test' check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='foo.test bar.test' check
 count_test_results total=5 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=3
 
 # Don't be too strict w.r.t. the format of the "skip whole test" message.
index 9513ca2ec7ef9e14d1f38f719293cbf80a27bfa7..39110ea73f79efd26355df967935e0ed82028614 100644 (file)
@@ -34,10 +34,7 @@ cat > baz.test <<END
 1..0 #  SKIP${tab}  Strip${tab}external  preserve ${tab}middle  ${tab}${sp}
 END
 
-run_make TESTS='foo.test bar.test baz.test' check > stdout \
-  || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O TESTS='foo.test bar.test baz.test' check
 count_test_results total=3 pass=0 fail=0 error=0 xpass=0 xfail=0 skip=3
 
 grep "SKIP: foo\\.test - Strip leading & trailing$" stdout
index d0ab69272bb8ba4a80b478eabb570dc806a9faf2..71cacf4e2764b1d427ea2cf0339394c40c1c8128 100644 (file)
@@ -56,10 +56,8 @@ cat > mu.test <<END
 1..0 # SKIP $weirdchars
 END
 
-run_make TESTS='foo.test bar.test baz.test wget.test curl.test mu.test' \
-  check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check \
+  TESTS='foo.test bar.test baz.test wget.test curl.test mu.test'
 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=0 skip=6 error=0
 
 # Look for a regression where the "1..0" wasn't being stripped from the
index a4d52aae653eff8bf563d9202daceced6a40a95c..8503ef1f40589f19f5b07c89981e8802accf15c2 100644 (file)
@@ -65,8 +65,7 @@ test -f baz.log
 
 rm -f foo.log bar.log
 
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 test -f foo.log
 test -f bar.log
 grep '^PASS: foo\.test 1$' stdout
@@ -80,8 +79,7 @@ touch foo.test
 # We re-run only a successful test, but the tests that failed in the
 # previous run should still be taken into account, and cause an overall
 # failure.
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 grep '^PASS: foo\.test 1$' stdout
 grep '^PASS: foo\.test 2$' stdout
 grep 'ba[rz]\.test' stdout && exit 1
@@ -90,8 +88,7 @@ grep_summary
 
 $sleep
 touch zardoz
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 grep '^ERROR: baz\.test' stdout
 $EGREP '(foo|bar)\.test' stdout && exit 1
 is_newest baz.log zardoz
@@ -99,16 +96,14 @@ grep_summary
 
 # Now, explicitly retry with all test logs already updated, and ensure
 # that the summary is still displayed.
-run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
 $EGREP '(foo|bar|baz)\.test' stdout && exit 1
 grep_summary
 
 # The following should re-run foo.test (and only foo.test), even if its
 # log file is up-to-date.
 : > older
-run_make RECHECK_LOGS=foo.log check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=foo.log
 grep '^PASS: foo\.test 1$' stdout
 grep '^PASS: foo\.test 2$' stdout
 grep 'ba[rz]\.test' stdout && exit 1
index a42ff548bb8535dde66756f315275836cc5df526..b5b161b30ef59b22b7cadfa11567368f19809d4f 100644 (file)
@@ -70,10 +70,7 @@ cat > e.test <<END
 ok 0 # TODO
 END
 
-run_make TESTS='a.test b.test c.test d.test e.test' check >stdout \
-  && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL TESTS='a.test b.test c.test d.test e.test' check
 count_test_results total=5 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=5
 
 grep '^ERROR: a\.test 0 # OUT-OF-ORDER (expecting 1)$' stdout
index 11b68a32e3ee86a0a9b7c52ca5ba3916e028db48..b9d50c56937986f80a90888c235bf1c261a31bc0 100644 (file)
@@ -53,8 +53,7 @@ ok 3
 not ok 4
 ok 5 # SKIP
 END
-run_make XFAIL_TESTS=all.test check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL XFAIL_TESTS=all.test check
 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=1 skip=1 error=4
 grep '^ERROR: all\.test - too many tests run (expected 2, got 5)$' stdout
 grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
index 0c435de2b8d6a5bbd28c94548f5b829583535967..7340c4df926daee5522efc16a4421cb57771e850 100644 (file)
@@ -83,8 +83,7 @@ for vpath in : false; do
   $srcdir/configure
 
   : Run the tests for the first time.
-  run_make check >stdout && { cat stdout; exit 1; }
-  cat stdout
+  run_make -O -e FAIL check
   # All the test scripts should have run.
   test -f a.run
   test -f b.run
@@ -95,8 +94,7 @@ for vpath in : false; do
 
   : An empty '$(TESTS)' or '$(TEST_LOGS)' means that no test should be run.
   for var in TESTS TEST_LOGS; do
-    run_make "$var=" recheck >stdout || { cat stdout; exit 1; }
-    cat stdout
+    run_make -O "$var=" recheck
     count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
     test ! -e a.run
     test ! -e b.run
@@ -106,9 +104,7 @@ for vpath in : false; do
 
   : a.test was successful the first time, no need to re-run it.
   using_gmake || $sleep # Required by BSD make.
-  run_make TESTS=a.test recheck >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TESTS=a.test recheck
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
   test ! -e b.run
@@ -117,9 +113,7 @@ for vpath in : false; do
   : b.test failed, it should be re-run.  And make it pass this time.
   using_gmake || $sleep # Required by BSD make.
   echo OK > b.ok
-  run_make TEST_LOGS=b.log recheck >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TEST_LOGS=b.log recheck
   test ! -e a.run
   test -f b.run
   test ! -e c.run
@@ -129,17 +123,13 @@ for vpath in : false; do
 
   : No need to re-run a.test or b.test anymore.
   using_gmake || $sleep # Required by BSD make.
-  run_make TEST_LOGS=b.log recheck >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TEST_LOGS=b.log recheck
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
   test ! -e b.run
   test ! -e c.run
   using_gmake || $sleep # Required by BSD make.
-  run_make TESTS='a.test b.test' recheck >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TESTS='a.test b.test' recheck
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
   test ! -e b.run
@@ -149,9 +139,7 @@ for vpath in : false; do
   : as it contained an XPASS.  And this time, make it fail with
   : an hard error.
   echo dummy > c.err
-  run_make TEST_LOGS='a.log c.log' recheck >stdout \
-    && { cat stdout; exit 1; }
-  cat stdout
+  run_make -e FAIL -O TEST_LOGS='a.log c.log' recheck
   count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
   test ! -e a.run
   test ! -e b.run
@@ -164,9 +152,7 @@ for vpath in : false; do
   # Use 'echo', not ':'; see comments above for why.
   using_gmake || $sleep # Required by BSD make.
   echo dummy > c.ok
-  run_make TESTS='c.test a.test' recheck >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O TESTS='c.test a.test' recheck
   count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
   test ! -e b.run
@@ -177,8 +163,7 @@ for vpath in : false; do
   : Nothing should be rerun anymore, as all tests have been eventually
   : successful.
   using_gmake || $sleep # Required by BSD make.
-  run_make recheck >stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O recheck
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
   test ! -e b.run
index a21174a12841a738b0d9bec17dab27c33821371c..868eab0bda3918afa18916b8172d7f87b9736eef 100644 (file)
@@ -158,10 +158,8 @@ for vpath in : false; do
   grep '%% pass-xpass-fail-xfail-skip-error %%' test-suite.log
   test $(grep -c '%% ' test-suite.log) -eq 4
 
-  run_make TESTS='pass.t pass3-skip2-xfail.t' check >stdout \
-    || { cat stdout; cat test-suite.log; exit 1; }
+  run_make -O TESTS='pass.t pass3-skip2-xfail.t' check
   cat test-suite.log
-  cat stdout
   count_test_results total=7 pass=4 fail=0 skip=2 xfail=1 xpass=0 error=0
 
   cd $srcdir
index b3d42d929cc3f79df9f1a3088bf51841cadbde33..a58817fe8ab07460d20cff8a56593c02b1880e9e 100644 (file)
@@ -44,17 +44,11 @@ grep '^PASS: ok\.test' output
 $FGREP 'zardoz.log' output
 test ! -e test-suite.log
 
-# FIXME: this redirection is fishy... run_make needs to be enhanced
-run_make TESTS='zardoz2.test' check >output 2>&1 \
-  && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL TESTS='zardoz2.test' check
 $FGREP 'zardoz2.log' output
 test ! -e test-suite.log
 
-# FIXME: this redirection is fishy... run_make needs to be enhanced
-run_make TEST_LOGS='zardoz3.log' check >output 2>&1 \
-  && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL TEST_LOGS='zardoz3.log' check
 $FGREP 'zardoz3.log' output
 test ! -e test-suite.log
 
index d833d96216a944d5e379bbb4ea207a02fee34e25..7b5efdc5a3fc8c1c9e1514514e5c5a939d1237be 100644 (file)
@@ -152,8 +152,7 @@ test -f baz.trs
 rm -f foo.trs
 update_stamp
 touch bar.test
-run_make RECHECK_LOGS= check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O RECHECK_LOGS= check
 # Check that make has updated what it needed to, but no more.
 test -f foo.trs
 is_newest bar.trs bar.test
index f65096157bd82c43410b89b06ffa7ec95604bc92..b26b0e78ca4b8213cc1de7c986cd9dbbbaac5ec5 100644 (file)
@@ -107,8 +107,7 @@ $sleep
 touch stamp
 $sleep
 touch bar.test
-run_make RECHECK_LOGS= check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O RECHECK_LOGS= check
 test -r foo.trs
 is_newest bar.trs bar.test
 grep '^PASS: foo\.test' stdout
index 2f2533fb7dc159d110680f9dda5c091b6a7f9787..9418c0d27ecea959397a816c5fa9181572d0b36f 100644 (file)
@@ -50,8 +50,7 @@ cat stdout
 grep '^See \./my_test_suite\.log$' stdout
 
 mkdir bar
-run_make TEST_SUITE_LOG=bar/bar.log check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TEST_SUITE_LOG=bar/bar.log check
 grep '^See \./bar/bar\.log$' stdout
 
 cd ..
@@ -80,8 +79,7 @@ cat stdout
 grep '^See sub/test-suite\.log$' stdout
 cd ..
 
-run_make TEST_SUITE_LOG=foo.log check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TEST_SUITE_LOG=foo.log check
 grep '^See sub/foo\.log$' stdout
 
 :