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>
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.
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"
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
./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'.
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'.
./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
./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
# 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
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.
./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
./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
$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
grep '5BEG: :END5' output
grep '6BEG:.* prg2_cflags cflags .*am_ldflags ldflags.* :END6' output
grep '6BEG: .*am_cflags.* :END6' output && exit 1
+
$MAKE
:
# 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
# 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
# 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
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
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
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
{
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
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
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
'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
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
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
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
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'
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
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
# 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
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
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
# 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 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
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
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
# 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
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
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
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
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
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
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
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'
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'
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'
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
:
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
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
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
:
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
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
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
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
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.
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
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
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
# 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
$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
# 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
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
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
$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
: 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
: 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
: 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
: 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
: 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
# 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
: 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
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
$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
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
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
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 ..
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
: