From: Stefano Lattarini Date: Wed, 22 May 2013 21:29:47 +0000 (+0200) Subject: tests: avoid use of redirected 'run_make' invocations X-Git-Tag: v1.13.2b~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2a000cc181b4a66564b8378cad6843d1938f80a;p=platform%2Fupstream%2Fautomake.git tests: avoid use of redirected 'run_make' invocations 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 --- diff --git a/t/ax/tap-summary-aux.sh b/t/ax/tap-summary-aux.sh index 2270079..472c43f 100644 --- a/t/ax/tap-summary-aux.sh +++ b/t/ax/tap-summary-aux.sh @@ -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" diff --git a/t/ax/testsuite-summary-checks.sh b/t/ax/testsuite-summary-checks.sh index 94de72d..1b37134 100644 --- a/t/ax/testsuite-summary-checks.sh +++ b/t/ax/testsuite-summary-checks.sh @@ -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 diff --git a/t/check11.sh b/t/check11.sh index 3526d84..6be5aad 100644 --- a/t/check11.sh +++ b/t/check11.sh @@ -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'. diff --git a/t/check5.sh b/t/check5.sh index a708839..738b3a1 100644 --- a/t/check5.sh +++ b/t/check5.sh @@ -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 diff --git a/t/check7.sh b/t/check7.sh index 5575f95..1dd918b 100644 --- a/t/check7.sh +++ b/t/check7.sh @@ -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 diff --git a/t/color-tests.sh b/t/color-tests.sh index 9a0d435..3ddef99 100644 --- a/t/color-tests.sh +++ b/t/color-tests.sh @@ -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 diff --git a/t/distdir.sh b/t/distdir.sh index 94de0d2..4d1410d 100644 --- a/t/distdir.sh +++ b/t/distdir.sh @@ -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. diff --git a/t/exeext.sh b/t/exeext.sh index 604e9a5..7290233 100644 --- a/t/exeext.sh +++ b/t/exeext.sh @@ -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 diff --git a/t/libtool9.sh b/t/libtool9.sh index 9ab4d97..7a613dc 100644 --- a/t/libtool9.sh +++ b/t/libtool9.sh @@ -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 : diff --git a/t/parallel-tests-basics.sh b/t/parallel-tests-basics.sh index 4d0fe95..dbd7ac8 100644 --- a/t/parallel-tests-basics.sh +++ b/t/parallel-tests-basics.sh @@ -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 diff --git a/t/parallel-tests-cmdline-override.sh b/t/parallel-tests-cmdline-override.sh index ef78c26..d4d9abc 100644 --- a/t/parallel-tests-cmdline-override.sh +++ b/t/parallel-tests-cmdline-override.sh @@ -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 diff --git a/t/parallel-tests-exit-statuses.sh b/t/parallel-tests-exit-statuses.sh index a2d181c..54181e2 100644 --- a/t/parallel-tests-exit-statuses.sh +++ b/t/parallel-tests-exit-statuses.sh @@ -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 diff --git a/t/parallel-tests-extra-programs.sh b/t/parallel-tests-extra-programs.sh index b8d7a99..03800a8 100644 --- a/t/parallel-tests-extra-programs.sh +++ b/t/parallel-tests-extra-programs.sh @@ -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 diff --git a/t/parallel-tests-fork-bomb.sh b/t/parallel-tests-fork-bomb.sh index e63c0d7..1361bbd 100644 --- a/t/parallel-tests-fork-bomb.sh +++ b/t/parallel-tests-fork-bomb.sh @@ -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 diff --git a/t/parallel-tests-log-override-2.sh b/t/parallel-tests-log-override-2.sh index 54e2ed9..b08f756 100644 --- a/t/parallel-tests-log-override-2.sh +++ b/t/parallel-tests-log-override-2.sh @@ -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 diff --git a/t/parallel-tests-log-override-recheck.sh b/t/parallel-tests-log-override-recheck.sh index ff6f582..2bfac7f 100644 --- a/t/parallel-tests-log-override-recheck.sh +++ b/t/parallel-tests-log-override-recheck.sh @@ -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 diff --git a/t/subst-no-trailing-empty-line.sh b/t/subst-no-trailing-empty-line.sh index 3fcb1b7..5097f5f 100644 --- a/t/subst-no-trailing-empty-line.sh +++ b/t/subst-no-trailing-empty-line.sh @@ -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 diff --git a/t/tap-autonumber.sh b/t/tap-autonumber.sh index f1820ce..d89aa78 100644 --- a/t/tap-autonumber.sh +++ b/t/tap-autonumber.sh @@ -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' diff --git a/t/tap-bailout-leading-space.sh b/t/tap-bailout-leading-space.sh index c84c612..120ae03 100644 --- a/t/tap-bailout-leading-space.sh +++ b/t/tap-bailout-leading-space.sh @@ -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 diff --git a/t/tap-bailout-suppress-later-errors.sh b/t/tap-bailout-suppress-later-errors.sh index 7f60294..365e894 100644 --- a/t/tap-bailout-suppress-later-errors.sh +++ b/t/tap-bailout-suppress-later-errors.sh @@ -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 diff --git a/t/tap-bailout.sh b/t/tap-bailout.sh index b6c0f56..94100f4 100644 --- a/t/tap-bailout.sh +++ b/t/tap-bailout.sh @@ -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 diff --git a/t/tap-basic.sh b/t/tap-basic.sh index 5e4462b..c146088 100644 --- a/t/tap-basic.sh +++ b/t/tap-basic.sh @@ -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 diff --git a/t/tap-color.sh b/t/tap-color.sh index 997cb79..409663e 100644 --- a/t/tap-color.sh +++ b/t/tap-color.sh @@ -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 : diff --git a/t/tap-diagnostic.sh b/t/tap-diagnostic.sh index 59b1bda..96b2a3d 100644 --- a/t/tap-diagnostic.sh +++ b/t/tap-diagnostic.sh @@ -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 diff --git a/t/tap-doc2.sh b/t/tap-doc2.sh index 55c734b..742ae5e 100644 --- a/t/tap-doc2.sh +++ b/t/tap-doc2.sh @@ -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 diff --git a/t/tap-global-result.sh b/t/tap-global-result.sh index a4a1fd1..025d784 100644 --- a/t/tap-global-result.sh +++ b/t/tap-global-result.sh @@ -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 diff --git a/t/tap-merge-stdout-stderr.sh b/t/tap-merge-stdout-stderr.sh index ef99d82..74f6f2e 100644 --- a/t/tap-merge-stdout-stderr.sh +++ b/t/tap-merge-stdout-stderr.sh @@ -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 diff --git a/t/tap-msg0-bailout.sh b/t/tap-msg0-bailout.sh index 9e2bdce..c6b3ca5 100644 --- a/t/tap-msg0-bailout.sh +++ b/t/tap-msg0-bailout.sh @@ -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 diff --git a/t/tap-msg0-planskip.sh b/t/tap-msg0-planskip.sh index 3c6252d..71e882e 100644 --- a/t/tap-msg0-planskip.sh +++ b/t/tap-msg0-planskip.sh @@ -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 diff --git a/t/tap-out-of-order.sh b/t/tap-out-of-order.sh index bac7acd..bb26edd 100644 --- a/t/tap-out-of-order.sh +++ b/t/tap-out-of-order.sh @@ -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 diff --git a/t/tap-plan-corner.sh b/t/tap-plan-corner.sh index 27f41fd..7b64d3e 100644 --- a/t/tap-plan-corner.sh +++ b/t/tap-plan-corner.sh @@ -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 <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' diff --git a/t/tap-plan-leading-zero.sh b/t/tap-plan-leading-zero.sh index 00caeb4..92f43e4 100644 --- a/t/tap-plan-leading-zero.sh +++ b/t/tap-plan-leading-zero.sh @@ -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 : diff --git a/t/tap-plan-malformed.sh b/t/tap-plan-malformed.sh index e2dd7d0..82da569 100644 --- a/t/tap-plan-malformed.sh +++ b/t/tap-plan-malformed.sh @@ -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 diff --git a/t/tap-plan-middle.sh b/t/tap-plan-middle.sh index bfc473b..dd3247b 100644 --- a/t/tap-plan-middle.sh +++ b/t/tap-plan-middle.sh @@ -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 diff --git a/t/tap-plan-whitespace.sh b/t/tap-plan-whitespace.sh index 659a7e7..a3e2137 100644 --- a/t/tap-plan-whitespace.sh +++ b/t/tap-plan-whitespace.sh @@ -32,9 +32,7 @@ cat > bar.test <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 : diff --git a/t/tap-plan.sh b/t/tap-plan.sh index 50ae426..f17d904 100644 --- a/t/tap-plan.sh +++ b/t/tap-plan.sh @@ -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 diff --git a/t/tap-planskip-and-logging.sh b/t/tap-planskip-and-logging.sh index b3089e4..aaea4d0 100644 --- a/t/tap-planskip-and-logging.sh +++ b/t/tap-planskip-and-logging.sh @@ -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 diff --git a/t/tap-planskip-case-insensitive.sh b/t/tap-planskip-case-insensitive.sh index 54a644e..790d984 100644 --- a/t/tap-planskip-case-insensitive.sh +++ b/t/tap-planskip-case-insensitive.sh @@ -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 diff --git a/t/tap-planskip-late.sh b/t/tap-planskip-late.sh index ab3f336..94af3e8 100644 --- a/t/tap-planskip-late.sh +++ b/t/tap-planskip-late.sh @@ -32,8 +32,7 @@ cat > bar.test <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 diff --git a/t/tap-planskip-unplanned-corner.sh b/t/tap-planskip-unplanned-corner.sh index 2176469..36473b3 100644 --- a/t/tap-planskip-unplanned-corner.sh +++ b/t/tap-planskip-unplanned-corner.sh @@ -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. diff --git a/t/tap-planskip-whitespace.sh b/t/tap-planskip-whitespace.sh index 9513ca2..39110ea 100644 --- a/t/tap-planskip-whitespace.sh +++ b/t/tap-planskip-whitespace.sh @@ -34,10 +34,7 @@ cat > baz.test < 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 diff --git a/t/tap-planskip.sh b/t/tap-planskip.sh index d0ab692..71cacf4 100644 --- a/t/tap-planskip.sh +++ b/t/tap-planskip.sh @@ -56,10 +56,8 @@ cat > mu.test <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 diff --git a/t/tap-recheck-logs.sh b/t/tap-recheck-logs.sh index a4d52aa..8503ef1 100644 --- a/t/tap-recheck-logs.sh +++ b/t/tap-recheck-logs.sh @@ -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 diff --git a/t/tap-test-number-0.sh b/t/tap-test-number-0.sh index a42ff54..b5b161b 100644 --- a/t/tap-test-number-0.sh +++ b/t/tap-test-number-0.sh @@ -70,10 +70,7 @@ cat > e.test <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 diff --git a/t/tap-unplanned.sh b/t/tap-unplanned.sh index 11b68a3..b9d50c5 100644 --- a/t/tap-unplanned.sh +++ b/t/tap-unplanned.sh @@ -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 diff --git a/t/test-driver-custom-multitest-recheck2.sh b/t/test-driver-custom-multitest-recheck2.sh index 0c435de..7340c4d 100644 --- a/t/test-driver-custom-multitest-recheck2.sh +++ b/t/test-driver-custom-multitest-recheck2.sh @@ -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 diff --git a/t/test-driver-custom-multitest.sh b/t/test-driver-custom-multitest.sh index a21174a..868eab0 100644 --- a/t/test-driver-custom-multitest.sh +++ b/t/test-driver-custom-multitest.sh @@ -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 diff --git a/t/test-missing.sh b/t/test-missing.sh index b3d42d9..a58817f 100644 --- a/t/test-missing.sh +++ b/t/test-missing.sh @@ -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 diff --git a/t/test-trs-recover.sh b/t/test-trs-recover.sh index d833d96..7b5efdc 100644 --- a/t/test-trs-recover.sh +++ b/t/test-trs-recover.sh @@ -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 diff --git a/t/test-trs-recover2.sh b/t/test-trs-recover2.sh index f650961..b26b0e7 100644 --- a/t/test-trs-recover2.sh +++ b/t/test-trs-recover2.sh @@ -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 diff --git a/t/testsuite-summary-reference-log.sh b/t/testsuite-summary-reference-log.sh index 2f2533f..9418c0d 100644 --- a/t/testsuite-summary-reference-log.sh +++ b/t/testsuite-summary-reference-log.sh @@ -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 :