## Invocation of 'run_make' should not have output redirections.
sc_tests_no_run_make_redirect:
- @if grep -Pzo '.*\brun_make\b(.*(\\\n))*.*>.*' $(xtests); then \
- echo 'Do not redirect "run_make" invocations, use' \
- '"run_make {-E|-O|-M}" instead.' 1>&2; \
+ @if grep -Pzo '.*(\$$MAKE|\brun_make)\b(.*(\\\n))*.*>.*' $(xtests); \
+ then \
+ echo 'Do not redirect stdout/stderr in "run_make" or "$$MAKE"' \
+ 'invocations,' >&2; \
+ echo 'use "run_make {-E|-O|-M}" instead.' >&2; \
exit 1; \
fi
sed 's/MACRO_FOO/MACRO_BAR/' configure.ac > t
mv -f t configure.ac
-$MAKE Makefile >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M Makefile
grep "^aclocal.*:.*found macro.*MACRO_BAR.*m4_2/bar\.m4" output
grep "macro.*MACRO_FOO" output && exit 1
test ! -r foo
cmp configure.ac configure.tmp && fatal_ 'failed to edit configure.ac'
mv -f configure.tmp configure.ac
-$MAKE 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'You have another version of autoconf' stderr
grep 'aclocal.m4:.*this file was generated for autoconf 9999a' stderr
./configure
# "make distdir" should fail because NEWS does not mention 1.0a
-$MAKE check 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E -e FAIL check
grep 'NEWS not updated' stderr
test ! -e works
echo 'alpha 1.0a released' > NEWS
$MAKE check
test -f works
+
+:
for x in b c; do
test $x = b || cd sub
rm -f $x.h.in
- $MAKE $x.h.in 2>stderr && { cat stderr >&2; exit 1; }
- cat stderr >&2
+ run_make -E -e FAIL $x.h.in
test ! -f $x.h.in
if using_gmake; then
grep "No rule to make target [\`\"']$x\.h\.in[\`\"']" stderr
echo lib_LTLIBRARIES = libfoo.la >> Makefile.am
make_ok ()
{
- $MAKE ${1+"$@"} >output 2>&1 || { cat output; return 1; }
- cat output
+ run_make -M -- ${1+"$@"}
$FGREP 'unknown directive' output && return 1
rm -f output
# Checks for stray files possibly left around by less common
$AUTOMAKE -a
./configure --prefix "$(pwd)/inst"
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
grep '^PASS: subrun\.sh *$' stdout
grep 'PASS.*echo\.sh' stdout && exit 1
./configure
-$MAKE -n foo >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M -- -n foo
test ! -f foo
# Guard against possible infinite recursion.
$FGREP '::OOPS::' output && exit 1
-$MAKE foo >output 2>&1 || { cat output; exit 1; }
-cat output
-$MAKE foo
+run_make -M -- foo
# Guard against possible infinite recursion.
$FGREP '::OOPS::' output && exit 1
cd build
../configure
-$MAKE 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'mv.*the same file' stderr && exit 1
:
cat foo.test # For debugging.
echo 'this line will be removed' > four
echo 'this line will not be removed' > five
- st=0
- echo 'ok ok ok' | $MAKE check >stdout 2>stderr || st=1
- cat stdout
- cat stderr >&2
+ st=0; echo 'ok ok ok' | run_make -O -E -e IGNORE check || st=$?
cat four
test x"$am_serial_tests" = x"yes" || cat foo.log
test $st -eq 0
END
chmod a+x bar.test
-$MAKE check >out 2>&1 || { cat out; exit 1; }
-cat out
+run_make -M check
# The serial test driver does not strip VPATH components from
# the name of the test, but the parallel driver should.
if test x"$am_serial_tests" = x"yes"; then
- grep '^PASS: .*foo\.test *$' out
+ grep '^PASS: .*foo\.test *$' output
else
- grep '\.\./foo' out && exit 1
- grep '^PASS: foo\.test *$' out
+ grep '\.\./foo' output && exit 1
+ grep '^PASS: foo\.test *$' output
fi
-grep '^PASS: bar\.test *$' out
+grep '^PASS: bar\.test *$' output
rm -f test-suite.log foo.log bar.log
-FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 && { cat out; exit 1; }
-cat out
+run_make -M -e FAIL FOO_EXIT_STATUS=1 check
# The serial test driver does not strip VPATH components from
# the name of the test, but the parallel driver should.
if test x"$am_serial_tests" = x"yes"; then
- grep '^FAIL: .*foo\.test *$' out
+ grep '^FAIL: .*foo\.test *$' output
else
- grep '\.\./foo' out && exit 1
- grep '^FAIL: foo\.test *$' out
+ grep '\.\./foo' output && exit 1
+ grep '^FAIL: foo\.test *$' output
fi
-grep '^PASS: bar\.test *$' out
+grep '^PASS: bar\.test *$' output
rm -f test-suite.log foo.log bar.log
# Check that if the same test is present in srcdir and builddir,
# the one in builddir is preferred.
cp bar.test foo.test
-FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 || { cat out; exit 1; }
-cat out
-grep '^PASS: foo\.test *$' out
-grep '^PASS: bar\.test *$' out
+run_make -M FOO_EXIT_STATUS=1 check
+grep '^PASS: foo\.test *$' output
+grep '^PASS: bar\.test *$' output
# The tests in the builddir must be preferred also by "make dist".
FOO_EXIT_STATUS=1 $MAKE distcheck
$AUTOMAKE -a
./configure
-(
+(
run_make -e IGNORE TESTS=pass check
run_make -e IGNORE TESTS=fail check
run_make -e IGNORE TESTS=skip check
$AUTOMAKE
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
grep '^PASS: subrun\.sh *$' stdout
grep 'PASS.*echo\.sh' stdout && exit 1
./configure --prefix "$(pwd)/inst"
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL -- check
grep '^FAIL: fail\.sh *$' stdout
grep '^PASS: ok\.sh *$' stdout && exit 1
# The exit status of 'make -k' can be anything
# (depending on the Make implementation)
-$MAKE -k check >stdout || :
-cat stdout
+run_make -O -e IGNORE -- -k check
grep '^FAIL: fail\.sh *$' stdout
grep '^PASS: ok\.sh *$' stdout
# Should also works when -k is not in first position.
-$MAKE -s -k check >stdout || :
-cat stdout
+run_make -O -e IGNORE -- -s -k check
grep '^FAIL: fail\.sh *' stdout
grep '^PASS: ok\.sh *' stdout
# Try with a long-option that do not have a short option equivalent
# (here, --no-print-directory). That should cause all options to
# appear verbatim in MAKEFLAGS.
- $MAKE --no-print-directory -k check >stdout || :
- cat stdout
+ run_make -e FAIL -O -- --no-print-directory -k check
grep '^FAIL: fail\.sh *$' stdout
grep '^PASS: ok\.sh *$' stdout
fi
$AUTOMAKE -a
./configure
-AM_COLOR_TESTS=always $MAKE check >stdout 2>stderr &&
- { cat stdout; cat stderr >&2; exit 1; }
-cat stdout
-cat stderr >&2
+run_make -E -O -e FAIL check
grep 'XPASS.* foo$' stdout
grep '^[^X]*PASS.* sub/foo$' stdout
grep '^[^X]*PASS.* bar' stdout
mkdir build
cd build
../configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
# Note: we are not grepping for the space in the lines from the 'foo'
# tests, due to the Solaris make VPATH rewriting (if we fix that, we
# can still write a separate test for it).
# version.good should depend on version.gin.
rm -f version.good
- $MAKE version.good >output 2>&1 && { cat output; exit 1; }
- cat output
+ run_make -M -e FAIL version.good
# Try to verify that we errored out for the right reason.
$FGREP version.gin output
fi
}
+our_make ()
+{
+ set "MAKE=$MAKE" ${1+"$@"}
+ env "$@" expect -f $srcdir/expect-make >stdout || { cat stdout; exit 1; }
+ cat stdout
+}
+
cat >expect-make <<'END'
eval spawn $env(MAKE) -e check
expect eof
$srcdir/configure
- TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ our_make TERM=ansi
test_color
- TERM=dumb MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ our_make TERM=dumb
test_no_color
- AM_COLOR_TESTS=no MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ our_make AM_COLOR_TESTS=no
test_no_color
$srcdir/configure testsuite_colorized=false
- TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ our_make TERM=ansi
test_no_color
- TERM=ansi MAKE="env AM_COLOR_TESTS=always $MAKE" \
- expect -f $srcdir/expect-make >stdout || { cat stdout; exit 1; }
- cat stdout
+ our_make TERM=ansi MAKE="env AM_COLOR_TESTS=always $MAKE"
test_color
$MAKE distclean
$AUTOMAKE
./configure
-$MAKE dep-test1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O dep-test1
$FGREP 'BEG: one.z somethingelse.a :END' stdout
-$MAKE dep-test2 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O dep-test2
$FGREP 'BEG: three.z :END' stdout
./configure two=2
-$MAKE dep-test1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O dep-test1
$FGREP 'BEG: two.z somethingelse.a :END' stdout
-$MAKE dep-test2 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O dep-test2
$FGREP 'BEG: two.z somethingelse.a :END' stdout
:
$AUTOMAKE
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
grep GrepMe1 stdout && exit 1
-$MAKE install >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O install
grep GrepMe2 stdout
./configure case_A=1
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
grep GrepMe1 stdout
-$MAKE install >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O install
grep GrepMe2 stdout && exit 1
:
$AUTOMAKE --add-missing
./configure COND=true
-$MAKE 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'overriding commands' stderr && exit 1
$MAKE sure-exist
./prog1 && exit 1
$MAKE distclean
./configure COND=false
-$MAKE 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'overriding commands' stderr && exit 1
./prog1
./sub/prog2
$MAKE
cd bar
-$MAKE top-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O top-rule
grep 'top rule' stdout
-$MAKE bot-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O bot-rule
grep 'bot rule' stdout
cd ..
$MAKE
cd bar
-$MAKE top-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O top-rule
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O bot-rule
grep 'bot rule' stdout
cd ..
$MAKE
cd bar
-$MAKE top-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O top-rule
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O bot-rule
grep 'bot2 rule' stdout
cd ..
touch Makefile.am
# Check that remake rules do truly break -- otherwise automake is
# giving a bogus warning.
-$MAKE 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -e FAIL -E
grep "config\\.status:.*invalid argument.*Makefile" stderr
:
fi
r=ok
- $MAKE cscope 2>stderr || r='not ok'
- cat stderr >&2
+ run_make -E cscope || r='not ok'
grep 'cannot find file' stderr && r='not ok'
rm -f stderr
result_ "$r" "[$pfx] make cscope"
# Ensure that the envvar RUNTESTFLAGS is used.
# Report from Mark Mitchell.
-RUNTESTFLAGS=--unknown-runtest-option $MAKE check >output 2>&1 \
- && { cat output; exit 1; }
-cat output
+RUNTESTFLAGS=--unknown-runtest-option; export RUNTESTFLAGS
+run_make -M -e FAIL check
$FGREP 'unknown-runtest-option' output
:
rm -f zardoz.am
$sleep # Required to avoid racy failures with FreeBSD make.
-$MAKE >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M
# This error will come from automake, not make, so we can be stricter
# in our grepping of it.
grep 'cannot open.*zardoz\.am' output
$MAKE # Sanity check.
rm -f foobar.am
$sleep # Required to avoid racy failures with FreeBSD make.
-$MAKE >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M
# This error will come from automake, not make, so we can be stricter
# in our grepping of it.
grep 'cannot open.*foobar\.am' output
$MAKE
rm -f zardoz.m4
-$MAKE >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M
# This error will come from aclocal, not make, so we can be stricter
# in our grepping of it.
grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' output
./configure
$MAKE # Sanity check.
rm -f foobar.m4
-$MAKE >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M
# This error will come from aclocal, not make, so we can be stricter
# in our grepping of it.
grep 'foobar\.m4.*does not exist' output
cd $distdir
./configure
fi
- $MAKE >output 2>&1 && { cat output; exit 1; }
- cat output
+ run_make -e FAIL -M
# This error comes from automake, not make, so we can be stricter
# in our grepping of it.
grep 'cannot open.*zardoz\.am' output
cd $distdir
./configure
fi
- $MAKE >output 2>&1 && { cat output; exit 1; }
- cat output
+ run_make -e FAIL -M
# This error will come from automake, not make, so we can be stricter
# in our grepping of it.
grep 'zardoz\.m4.*does not exist' output
cd $distdir
./configure
fi
- $MAKE >output 2>&1 && { cat output; exit 1; }
- cat output
+ run_make -e FAIL -M
# This error will come from autoconf, not make, so we can be stricter
# in our grepping of it.
grep 'possibly undefined .*MY_ZARDOZ' output
$AUTOMAKE Makefile
./config.status Makefile
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M distcheck
grep "^configure:.* success='no', sentence='it works :-)'" output
$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-success=yes"
# ... but not when "make distcheck" is run from the subpackage.
cd subpkg
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M distcheck
grep '^configure:.* dc=KO am_dc=KO' output
:
DISTCHECK_CONFIGURE_FLAGS="--enable-success=yes sentence='it works :-)'"
# Sanity check.
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL distcheck
grep "^configure:.* success='no', sentence=''" output
:
./configure
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL distcheck
for x in bar baz zar; do
$EGREP "required m4 file.*not distributed.* $x.m4( |$)" output
done
$MAKE
$EGREP 'MY_(FOO|BAR|BAZ|QUX|ZAR|BLA)' configure && exit 1 # Sanity check.
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL distcheck
$EGREP "required m4 file.*not distributed.* qux.m4( |$)" output
$EGREP "required m4 file.*not distributed.* bla.m4( |$)" output
check_no_spurious_error
END
$MAKE # Rebuild configure and makefiles.
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
-
+run_make -M -e FAIL distcheck
$EGREP "required m4 file.* outdated.* baz.m4( |$)" output
check_no_spurious_error
# Check that we don't complain for files that aren't outdated.
END
$MAKE # Rebuild configure and makefiles.
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL distcheck
$EGREP "required m4 file.* outdated.* fnord.m4( |$)" output
check_no_spurious_error
# Check that we don't complain for files that aren't outdated.
./configure
# We can build the distribution.
-$MAKE distcheck >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M -e FAIL distcheck
# Sanity check: verify that our code has hit a problem removing
# the distdir, but has recovered from it.
grep "rm:.*$destdir" output || fatal_ "expected code path not covered"
test -f inst/share/dir
rm -rf inst
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
-
+run_make -M -e FAIL distcheck
$FGREP 'ERROR: files left after uninstall:' output
grep '/share/dir *$' output
test -f inst/share/info/more/dir
rm -rf inst
-$MAKE distcheck >output 2>&1 && { cat output; exit 1; }
-cat output
-
+run_make -M -e FAIL distcheck
$FGREP 'ERROR: files left after uninstall:' output
grep '/mu/share/info/dir *$' output
grep '/share/info/more/dir *$' output
$AUTOMAKE
./configure
$MAKE
-$MAKE distcheck 2>stderr && { cat srderr >&2; exit 1; }
-cat stderr >&2
-
+run_make -E -e FAIL distcheck
grep 'ERROR:.*files left in build directory after distclean' stderr
grep '^\./foo\.1$' stderr
$AUTOMAKE
./configure
# Distribution must fail, with a decent error message.
- $MAKE distdir >out 2>&1 && { cat out; exit 1; }
- cat out
- $FGREP $lnk out
+ run_make -M -e FAIL distdir
+ $FGREP $lnk output
done
:
: >foodep
: >foodep2
: >bardep
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
grep 'making libfoodep' stdout
rm -f bardep
: >foodep
: >foodep2
: >bardep
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
grep 'making libfoodep' stdout
rm -f foodep
mkdir -p 12345678 && cd 12345678 && touch x || exit 1
done) || skip_ "failed to create deeper directory hierarchy"
-$MAKE dist 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E -e FAIL dist
grep 'filenames are too long' stderr
test 2 -eq $(grep -c 12345678 stderr)
mkdir -p 12345678 && cd 12345678 && touch x || exit 1
done) || skip_ "failed to create deeper directory hierarchy"
-$MAKE dist 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E -e FAIL dist
grep 'filenames are too long' stderr
test 1 -eq $(grep -c 12345678 stderr)
../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
$MAKE all
$MAKE test-install
-$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
-cat stderr >&2
+# Don't trust th exit status of "make -k" for non-GNU makes.
+if using_gmake; then status=FAIL; else status=IGNORE; fi
+run_make -e $status -E -- -k installcheck
$MAKE grep-stderr
:
$MAKE
$MAKE install
$MAKE installcheck && exit 1
-$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
-cat stderr >&2
+# Don't trust th exit status of "make -k" for non-GNU makes.
+if using_gmake; then status=FAIL; else status=IGNORE; fi
+run_make -e $status -E -- -k installcheck
$MAKE grep-stderr
# Make sure there is no more error when all targets are exempted.
exit 127
END
chmod a+x bin/install-info
-$MAKE install-info >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M install-info
test -f $instdir/info/foo.info
test ! -e $instdir/info/dir
grep 'error from install-info' output && exit 1
$AUTOMAKE --add-missing --copy
./configure "--prefix=$(pwd)/_inst"
-env LIBTOOLFLAGS=--silent $MAKE print >output 2>&1 || {
- cat output
- exit 1
-}
-cat output
+
+run_make -M print LIBTOOLFLAGS=--silent
grep '1BEG: libmod1.la mod2.la :END1' output
grep '2BEG: mod2.la :END2' output
grep '3BEG: .*silent.*silent.* :END3' output
test 2 -le $(grep mod2_la_LIBTOOLFLAGS Makefile | wc -l)
+
$MAKE
-env LIBTOOLFLAGS=--silent $MAKE install >output 2>&1 || {
- cat output
- exit 1
-}
-cat output
+run_make -M install LIBTOOLFLAGS=--silent
grep 'silent.*silent.*prg' output
grep 'silent.*silent.*libmod1' output
-env LIBTOOLFLAGS=--silent $MAKE uninstall >output 2>&1 || {
- cat output
- exit 1
-}
-cat output
+run_make -M uninstall LIBTOOLFLAGS=--silent
grep 'silent.*silent.*libmod1' output
:
$AUTOMAKE --add-missing
./configure
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O
test ! -e am-one.elc
test ! -e am-two.elc
test ! -e am-three.elc
./configure
# Use append mode here to avoid dropping output. See automake bug#11413.
+# TODO: port this to to run_make(), and rewrite this hunk to use that
+# function ...
: >stdout
$MAKE -j >>stdout || { cat stdout; exit 1; }
-
cat stdout
test -f am-one.elc
rm -f am-*.elc
# Use append mode here to avoid dropping output. See automake bug#11413.
+# TODO: port this to to run_make(), and rewrite this hunk to use that
+# function ...
: >stdout
$MAKE -j >>stdout || { cat stdout; exit 1; }
-
cat stdout
+
test -f am-one.elc
test -f am-two.elc
test -f am-three.elc
./configure --prefix="$(pwd)/inst"
$MAKE
-$MAKE install 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E install
grep 'has not been installed' stderr && exit 1
$MAKE uninstall
rm -f ok ko
-$MAKE -s file >output 2>&1
-cat output
+run_make -M -- -s file
if using_gmake; then
test -f ok
test ! -e ko
install-info install-html install-dvi install-pdf install-ps \
installcheck installdirs tags mostlyclean maintainer-clean
do
- $MAKE -n $target >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O -- -n $target
case $target in
install-* | installdirs | tags ) ;;
*)
$AUTOCONF
$AUTOMAKE
./configure
-$MAKE >output
-cat output
-grep in--mk output
-grep in--sub output
-grep at--toplevel output
+run_make -O
+grep in--mk stdout
+grep in--sub stdout
+grep at--toplevel stdout
$MAKE distcheck
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
test -f test-suite.log
cat test-suite.log
# Check parallel-tests features:
# - concurrent parallel execution
+# FIXME: we should factorize the code to determine how to run
+# make in parallel out in am-test-lib.sh ...
+
. test-init.sh
case $MAKE in
cd ../parallel
$sleep
# Use append mode here to avoid dropping output. See automake bug#11413.
+# TODO: port this to to run_make(), and rewrite this hunk to use that
+# function ...
: > stdout
$MAKE ${j}4 check >> stdout
cd ..
srcdir=.
fi
$srcdir/configure
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
LC_ALL=C grep '^[A-Z][A-Z]*:' stdout > got
cat got
diff $srcdir/exp got
make_n_ ()
{
st=0
- $MAKE -n "$@" >output 2>&1 || { cat output; ls -l; exit 1; }
- cat output
+ run_make -M -- -n "$@" || { ls -l; exit 1; }
# Look out for possible errors from common tools used by recipes.
$EGREP -i ' (exist|permission|denied|no .*(such|file))' output && exit 1
$EGREP '(mv|cp|rm|cat|grep|sed|awk): ' output && exit 1
# See 'parallel-tests-trailing-whitespace.sh' for a similar issue.
. test-init.sh
+
cat >> configure.ac << 'END'
AC_OUTPUT
END
$AUTOMAKE -a
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
for x in TOTAL PASS FAIL XPASS FAIL SKIP ERROR; do
grep "^# $x: *0$" stdout
done
-exit 0
+:
# 'test-suite.log' file shouldn't be created (as it depends
# on *all* the test logs).
-st=0
-$MAKE -k check >stdout 2>stderr || st=$?
-cat stdout
-cat stderr >&2
+run_make -E -O -e IGNORE -- -k check
ls -l
if using_gmake; then
- test $st -gt 0 || exit 1
+ test $am_make_rc_got -gt 0 || exit 1
else
# Don't trust exit status of "make -k" for non-GNU make.
$MAKE check && exit 1
grep '^qux\.log:' Makefile && st=1
test $st -eq 0 || fatal_ "doesn't cover expected code paths"
-st=0
-$MAKE check >stdout || st=1
-cat stdout
+run_make -O -e IGNORE check
cat baz.log
cat qux.log
-test $st -eq 0
+test $am_make_rc_got -eq 0
grep "^ bazbazbaz$" stdout
grep "^ quxquxqux$" stdout
$EGREP '(bazbazbaz|quxquxqux)' *.log && exit 1
grep '^foo\.log:' Makefile && st=1
test $st -eq 0 || fatal_ "doesn't cover expected code paths"
-st=0; $MAKE check >stdout || st=1
-cat stdout
+run_make -O -e IGNORE check
cat foo.log
cat bar.log
-test $st -eq 0
+test $am_make_rc_got -eq 0
grep "^ foofoofoo$" stdout
grep "^ barbarbar$" stdout
$EGREP '(foofoofoo|barbarbar)' *.log && exit 1
}
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
using_gmake || $sleep # Required by BSD make.
./configure
-st=0
-$MAKE check >stdout || st=$?
-cat stdout
+run_make -O -e IGNORE check
cat test-suite.log
cat foo.log
cat bar.log
-test $st -eq 0 || exit $st
+test $am_make_rc_got -eq 0
grep '^:test-result:XFAIL$' foo.log
grep '^:test-result: SKIP$' foo.log
$AUTOMAKE -a
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=1 fail=2 skip=0 xfail=0 xpass=0 error=0
test ! -e status
}
END
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
grep '^PASS: b\.test$' stdout
grep '^PASS: c\.test$' stdout
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
count_test_results total=0 pass=0 fail=0 skip=0 xfail=0 xpass=0 error=0
:
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0
$sleep # Required to avoid a spurious failure with some FreeBSD makes.
-st=0; $MAKE -k recheck >stdout || st=$?
-cat stdout
+run_make -O -e IGNORE -- -k recheck
# Don't trust the exit status of "make -k" for non-GNU makes.
-if using_gmake && test $st -eq 0; then exit 1; fi
+! using_gmake || test $am_make_rc_got -gt 0 || exit 1
count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0
# Introduce an error in foo.c, that should cause a compilation failure.
$sleep
echo choke me >> foo.c
-$MAKE recheck >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL recheck
# We don't get a change to run the testsuite.
$EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && exit 1
# These shouldn't be removed, otherwise the next make recheck will do
test -f foo.trs
$sleep # Required to avoid a spurious failure with some FreeBSD makes.
-st=0; $MAKE -k recheck >stdout || st=$?
-cat stdout
+run_make -O -e IGNORE -- -k recheck
# Don't trust the exit status of "make -k" for non-GNU makes.
-if using_gmake && test $st -eq 0; then exit 1; fi
+! using_gmake || test $am_make_rc_got -gt 0 || exit 1
# We don't get a change to run the testsuite.
$EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && exit 1
test -f foo.log
$sleep
echo 'int main (void) { return 0; }' > foo.c
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
test -f foo.log
test -f foo.trs
-$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 -f foo.log
test -f foo.trs
$AUTOMAKE -a
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
# Running this two times in a row should produce the same results the
# second time.
for i in 1 2; do
using_gmake || $sleep # Required by BSD make.
- $MAKE recheck >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL recheck
count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1
grep 'foo\.test' stdout && exit 1
grep '^ERROR: bar\.test$' stdout
mkcheck ()
{
- if $MAKE "$@" check > stdout; then
- rc=0
- else
- rc=1
- fi
+ run_make -O -e IGNORE "$@" check
cat stdout
cat foobar.log
cat test-suite.log
- return $rc
+ return $am_make_rc_got
}
$ACLOCAL
$AUTOMAKE
./configure
-$MAKE print >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O print
$FGREP 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
:
$AUTOMAKE -a
./configure
-$MAKE check >out 2>&1 && { cat out; exit 1; }
-cat out
+run_make -M -e FAIL check
ls -l
-grep '^FAIL: foo1\.test *$' out
-grep '^PASS: foo2\.test *$' out
-grep '^FAIL: bary *$' out
-grep '^PASS: barz *$' out
+grep '^FAIL: foo1\.test *$' output
+grep '^PASS: foo2\.test *$' output
+grep '^FAIL: bary *$' output
+grep '^PASS: barz *$' output
test -f foo1.out
test -f bary.out
# A rule in the Makefile should create subdir.
test ! -e subdir
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
test -d subdir
grep 'liba.la .*-rpath .*lib' stdout
test -f subdir/liba.la
test -f subdir/libb.la
-$MAKE install 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E install
grep 'remember.*--finish' stderr && exit 1
test -f inst/lib/liba.la
mv aclocal.tmp aclocal.m4
-$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'You have another version of autoconf' stderr
grep 'aclocal.m4:.*this file was generated for' stderr
-$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E
grep 'You have another version of autoconf' stderr && exit 1
grep 'aclocal.m4:.*this file was generated for' stderr && exit 1
do_check ()
{
- $MAKE >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O
test $(grep -c "/missing " stdout) -eq 1
}
$MAKE good
-$MAKE bad SHELL="$SHELL" 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_make -E -e FAIL bad SHELL="$SHELL"
$FGREP "recipe ends with backslash character" stderr
:
./configure --enable-silent-rules $config_args
- $MAKE >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
grep 'mv ' stdout && exit 1
grep 'CC .*foo\.' stdout
grep 'CCLD .*bla' stdout
$MAKE clean
- $MAKE V=1 >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O V=1
grep ' -c' stdout
grep ' -o foo' stdout
$EGREP '(CC|LD) ' stdout && exit 1
esac
shift
$MAKE clean
- $MAKE ${1+"$@"} >output 2>&1 || { cat output; exit 1; }
- sed 's/^/ /' output
+ run_make -M -- ${1+"$@"}
if $silent; then
$FGREP 'cp ' output && exit 1
$FGREP 'generate-header' output && exit 1
for config_args in \
--enable-dependency-tracking --disable-dependency-tracking
do
+
./configure $config_args --enable-silent-rules
- $MAKE >stdout || { cat stdout; exit 1; }
- cat stdout
+
+ run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
grep 'mv ' stdout && exit 1
# Ensure a clean rebuild.
$MAKE clean
- $MAKE V=1 >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
$AUTOCONF
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
# Avoid spurious failures with SunStudio Fortran compilers.
sed '/^NOTICE:/d' stdout > t
mv -f t stdout
# Ensure a clean rebuild.
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
$AUTOCONF
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
# Avoid spurious failures with SunStudio Fortran compilers.
sed '/^NOTICE:/d' stdout > t
mv -f t stdout
# Ensure a clean rebuild.
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
# Silent rules are disabled by default, since we haven't called
# "AM_SILENT_RULES([yes])" explicitly.
./configure
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
grep 'GEN ' stdout && exit 1
grep 'cp ' stdout
grep 'echo ' stdout
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep 'GEN ' stdout && exit 1
grep 'cp ' stdout
grep 'echo ' stdout
$MAKE clean
-$MAKE V=0 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=0
grep 'GEN .*foo' stdout
grep 'cp ' stdout && exit 1
grep 'echo ' stdout && exit 1
$MAKE distclean
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
grep 'GEN .*foo' stdout
grep 'cp ' stdout && exit 1
grep 'echo ' stdout && exit 1
$MAKE clean
-$MAKE V=0 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=0
grep 'GEN .*foo' stdout
grep 'cp ' stdout && exit 1
grep 'echo ' stdout && exit 1
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep 'GEN ' stdout && exit 1
grep 'cp ' stdout
grep 'echo ' stdout
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
# different set of rules.
$MAKE clean
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
$MAKE clean
rm -f *foo.c sub/*bar.c
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
# different set of rules.
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
# Don't look for ylwrap, as probably lex hasn't been re-run.
grep ' -c ' stdout
./configure --enable-silent-rules $config_args
- $MAKE >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
grep 'mv ' stdout && exit 1
grep ' CCLD .*bla' stdout
$MAKE clean
- $MAKE V=1 >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O V=1
grep ' -c' stdout
grep ' -o libfoo' stdout
# The libtool command line can contain e.g. a '--tag=CC' option.
*) rebuild=false;;
esac
- $MAKE >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O
# Avoid spurious failures with SunStudio Fortran compilers.
sed '/^NOTICE:/d' stdout > t
mv -f t stdout
*) rebuild=false;;
esac
- $MAKE V=1 >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
$EGREP 'CC|AM_V|GEN' Makefile # For debugging.
grep '^AM_V_CC = *\$(am__v_CC_0) *$' Makefile
grep '^AM_V_GEN = *\$(am__v_GEN_0) *$' Makefile
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
grep 'mv ' stdout && exit 1
grep 'echo .*oop' stdout && exit 1
grep '^AM_V_CC = *\$(am__v_CC_1) *$' Makefile
grep '^AM_V_GEN = *\$(am__v_GEN_1) *$' Makefile
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
grep ' -c' stdout
grep ' -o foo' stdout
grep ' -o bar' stdout
./configure --disable-silent-rules
# Silent mode output.
-st=0
-$MAKE V=0 dvi html info ps pdf >stdout 2>stderr || st=$?
-cat stdout
-cat stderr >&2
-test $st -eq 0
+run_make -O -E -- V=0 dvi html info ps pdf
grep '^ DVIPS foo\.ps$' stdout
grep '^ MAKEINFO foo\.html$' stdout
# NetBSD make will print './foo.info' instead of 'foo.info'.
# Verbose mode output.
$MAKE clean || exit 1
-$MAKE V=1 dvi html info ps pdf >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M V=1 dvi html info ps pdf
$EGREP '(DVIPS|MAKEINFO|TEXI2(PDF|DVI)) ' output && exit 1
# Verbose output from TeX.
grep '[Oo]utput .*foo\.pdf' output
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-d|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
# Check recovering from header removal.
rm -f parse.h bar-parse.h
-$MAKE parse.h bar-parse.h >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O parse.h bar-parse.h
$EGREP ' (-c|-d|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
# different set of rules.
$MAKE clean
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-d|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
# Check recovering from header removal.
rm -f parse.h bar-parse.h
-$MAKE parse.h bar-parse.h >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O parse.h bar-parse.h
$EGREP ' (-c|-d|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
./configure --enable-silent-rules
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
# Check recovering from header removal.
rm -f parse.h bar-parse.h
-$MAKE V=1 parse.h bar-parse.h >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1 parse.h bar-parse.h
grep ' -d ' stdout
grep 'ylwrap ' stdout
# different set of rules.
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
# Don't look for ylwrap, as probably lex hasn't been re-run.
grep ' -c ' stdout
# Check recovering from header removal.
rm -f parse.h bar-parse.h
-$MAKE V=1 parse.h bar-parse.h >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1 parse.h bar-parse.h
grep ' -d ' stdout
grep 'ylwrap ' stdout
./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
# different set of rules.
$MAKE clean
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
$EGREP ' (-c|-o)' stdout && exit 1
$EGREP '(mv|ylwrap) ' stdout && exit 1
$MAKE clean
rm -f *foo.[ch] sub/*bar.[ch]
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
grep ' -c ' stdout
grep ' -o ' stdout
# different set of rules.
$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O V=1
# Don't look for ylwrap, as probably lex hasn't been re-run.
grep ' -c ' stdout
# Opportunistically check that --tag=CXX is used when supported.
if ./libtool --help | grep tag=TAG; then
- $MAKE print >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O print
grep 'BEG1: .*--tag=CXX.*--mode=compile.* :1END' stdout
grep 'BEG2: .*--tag=CXX.*--mode=link.* :2END' stdout
fi
$MAKE
-$MAKE distcheck >output 2>&1 || { cat output; exit 1; }
-cat output
+run_make -M distcheck
# GNU Make used to complain that the Makefile contained two rules
# for 'src/.dirstamp' and './/src/.dirstamp'.
grep 'overriding commands' output && exit 1
not ok 6 # TODO TODO
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=6 pass=2 fail=2 xpass=0 xfail=1 skip=1 error=0
cat > exp << 'END'
./configure
-if $MAKE check >stdout; then
- r='not ok'
-else
- r='ok'
-fi
-cat stdout
-result_ "$r" '"make check" returns non-zero exit status'
+command_ok_ '"make check" returns non-zero exit status' \
+ run_make -O -e FAIL check
# FIXME: maybe grep for stricter error messages in the next checks?
chmod a+x $tests
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=4
+
for tst in $tests; do grep "^ERROR: $tst - Bail out!" stdout; done
$EGREP "ERROR: .*(exit.*status|terminat.*signal)" stdout && exit 1
# not seen
END
-# Doing the sums above, we have:
-
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
grep '# all.test: sanity check' stdout
grep 'not seen' stdout && exit 1
# Basilar usage and testsuite progress output.
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=20 pass=4 fail=4 xpass=4 xfail=4 skip=4 error=0
test -f success.log
chmod a+x *.test
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=5 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=0
cat > exp << 'END'
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
count_test_results total=$i pass=$i fail=0 xpass=0 xfail=0 skip=0 error=0
cat later.mk >> Makefile
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
$FGREP 'blah blah' stdout && exit 1
:
# all.test: Shell metacharacters here: $metacharacters
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O 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
echo 'AM_TEST_LOG_DRIVER_FLAGS = --comments' >> Makefile
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
$FGREP ' all.test' stdout > got
cat exp
cat got
#TODO
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
# Diagnostic without leading whitespace, or with extra leading whitespace,
# ${tab} ${tab}${tab}foo bar${tab}baz ${tab}
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
grep "^# all.test:${ws0p}foo$" stdout
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
cat > exp <<'END'
PASS: foo.sh
# Prevent Sun Distributed Make from trying to run in parallel.
DMAKE_MODE=serial; export DMAKE_MODE
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
cat > exp <<'END'
PASS: foo.test 1 - Swallows fly
# ${tab} $tab${tab}$
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
grep '^PASS:.*all\.test' stdout # Sanity check.
grep '#.*all\.test' stdout && exit 1
for input in empty blank white white2; do
cp $input.test all.test
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
grep '^ERROR: all\.test - missing test plan$' stdout
done
ok \\\\\\\\\\# SKIP
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=8 pass=2 fail=0 xpass=0 xfail=3 skip=3 error=0
grep '^XFAIL: all\.test 1 .*# TODO' stdout
ok \# SKIP
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=2 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=0
grep '^PASS: all\.test 1 .*# TODO' stdout
. tap-setup.sh
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=8 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=4
grep '^ERROR: exit1\.test - exited with status 1$' stdout
grep '^ERROR: exit99\.test - exited with status 99$' stdout
echo TEST_LOG_DRIVER_FLAGS = --ignore-exit >> Makefile
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
count_test_results total=4 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=0
:
ok~#TODO
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=21 pass=6 fail=6 xfail=4 xpass=1 skip=4 error=0
#
Bail out! $weirdchars
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=6 pass=1 fail=1 xfail=1 xpass=1 skip=1 error=1
$FGREP "PASS: all.test 1 $weirdchars" stdout
$FGREP "FAIL: all.test 2 $weirdchars" stdout
Bail out! $bs
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=6 pass=1 fail=1 xfail=1 xpass=1 skip=1 error=1
+
grep '^PASS: all\.test 1 \\$' stdout
grep '^FAIL: all\.test 2 \\$' stdout
grep '^XPASS: all\.test 3 # TODO \\$' stdout
# And add the test plan!
echo 1..$total >> all.test
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
$EGREP '^(PASS|FAIL|SKIP).*#.*TODO' stdout && exit 1
$EGREP '^X?(PASS|FAIL).*#.*SKIP' stdout && exit 1
rm -f *.log
-VERBOSE=yes $MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check VERBOSE=yes
cat global.log
test ! -e my.log
test ! -e test-suite.log
END
chmod a+x all.test
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
+
grep '^# all\.test: foo foo foo' stdout
cat > all.test <<END
echo 'Bail out!' >&2
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
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 -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
-
-
:
. tap-setup.sh
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=2
grep '^ERROR: foo\.test - exited with status 123$' stdout
./configure
for target in check distcheck; do
- $MAKE $target >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O $target
count_test_results total=3 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=0
done
ok 3 # SKIP 0
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=3 pass=0 fail=0 xpass=1 xfail=1 skip=1 error=0
grep '^XPASS: all\.test 1 # TODO 0$' stdout
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=14 pass=2 fail=0 xpass=4 xfail=4 skip=4 error=0
sed '/^ *$/d' > exp << 'END'
ok - 0 # SKIP
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
cat > exp << 'END'
not ok -50000
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=7 pass=2 fail=2 xpass=1 xfail=1 skip=1 error=0
cat > exp <<'END'
# nothing here
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=3
:
chmod a+x all.test
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=1 error=0
+
$FGREP 'foo foo foo' stdout
$FGREP 'bar bar bar' stdout && exit 1
test $(wc -l <all.test) -lt $highno \
|| framework_failure_ "creating all.test"
-$MAKE check >stdout || :
-cat stdout
-
+run_make -O -e IGNORE check
count_test_results total=$total pass=$pass fail=$fail skip=$skip \
xpass=$xpass xfail=$xfail error=$error
ok 1
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
for result in PASS FAIL XPASS XFAIL SKIP ERROR UNKNOWN; do
&& test $(grep -c '^not ok1$' all.test) -eq 1 \
|| framework_failure_ "creating all.test"
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=5 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=0
:
not ok 4 - bar # SKIP
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=4 pass=0 fail=4 skip=0 xpass=0 xfail=0 error=0
:
ok 5"`!! foo5 # TODO
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=5 pass=1 fail=1 skip=1 xpass=1 xfail=1 error=0
$EGREP '^PASS: all\.test 1 ?: foo1$' stdout
ok 476$ # SKIP
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=3 pass=0 fail=0 skip=0 xpass=0 xfail=0 error=3
$EGREP '^ERROR: all\.test 2 ?: quux # OUT-OF-ORDER \(expecting 1\)$' stdout
# Sanity check.
grep "^ok 1'$" all.test || framework_failure_ "creating all.test"
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=$planned pass=$planned \
fail=0 skip=0 xpass=0 xfail=0 error=0
do_checks ()
{
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
count_test_results "$@"
# Allow some normalization of leading zeros, without forcing it.
LC_ALL=C sed -n 's/: all\.test 0*\([0-9]\)/: all.test \1/p' stdout > got
XPASS: all.test 10 - ${x10} # TODO
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
$FGREP ': all.test' stdout > got
cat > all.test
test -n "$err" || fatal_ "\$err not set before calling my_check"
cat all.test # For debugging.
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
count_test_results "$@"
grep "^ERROR: all\\.test $err$" stdout
unset err
chmod a+x one.test two.test
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
# The 'prove' utility reports both the skip and the non-zero exit status,
# so we do the same.
Bail out!
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=1
grep '^ERROR: all\.test - Bail out!' stdout
1..1
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=3
test $(grep -c '^ERROR: all\.test - multiple test plans' stdout) -eq 3
ok 1
1..0 # SKIP too late
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
grep '^ERROR: all\.test - too many tests run (expected 0, got 1)$' stdout
not ok 3 # TODO
1..0 # SKIP too late
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=4 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=1
grep '^ERROR: all\.test - too many tests run (expected 0, got 3)$' stdout
1..0 # SKIP falsified later
ok 1
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=2
grep '^ERROR: all\.test 1 # UNPLANNED$' stdout
grep '^ERROR: all\.test - too many tests run (expected 0, got 1)$' stdout
not ok 3
not ok 4 # TODO
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=6 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=5
grep '^ERROR: all\.test 1 # UNPLANNED$' stdout
grep '^ERROR: all\.test 2 # UNPLANNED$' stdout
do_recheck ()
{
case $* in
- --fail) on_bad_rc='&&';;
- --pass) on_bad_rc='||';;
+ --fail) status=FAIL;;
+ --pass) status=0;;
*) fatal_ "invalid usage of function 'do_recheck'";;
esac
rm -f *.run
- eval "\$MAKE recheck >stdout $on_bad_rc { cat stdout; ls -l; exit 1; }; :"
- cat stdout; ls -l
+ run_make -O -e $status recheck || { ls -l; exit 1; }
+ ls -l
}
for vpath in : false; do
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
: Run the tests for the first time.
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
ls -l
# All the test scripts should have run.
test -f a.run
ok 5 # ${tab}${tab}TOOD${tab}${sp}${sp}
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=5 pass=3 fail=2 xpass=0 xfail=0 skip=0 error=0
# Don't be too strict about trailing white space.
command_ok_ '"make check" fails' eval '
(
- st=0; $MAKE check >stdout || st=$?
- cat stdout
+ run_make -e IGNORE -O check
# Extra "echo" and silencing of xtraces required to avoid possible
# garbled output with NetBSD make, which would miss some final
# newlines in the expected places and thus mess up our TAP output.
set +x; echo
- test $st -gt 0
+ test $am_make_rc_got -gt 0
)
'
cat stdout # For debugging.
echo 'TEST_LOG_DRIVER_FLAGS = --ignore-exit' >> Makefile
-command_ok_ '"make check" passes [--ignore-exit]' eval '$MAKE check >stdout'
-cat stdout # For debugging.
+command_ok_ '"make check" passes [--ignore-exit]' run_make -O check
command_ok_ "count of test results [--ignore-exit]" count_test_results \
total=$results_count pass=$results_count \
not ok 2 # TODO SKIP
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=1 skip=1 error=0
grep '^SKIP: all\.test 1 ' stdout
*) fatal_ "bad argument '$1' for my_make_check";;
esac
cat all.test
- $MAKE check >stdout || : # Don't care about the exit status in this test.
- cat stdout
+ # We don't care about the exit status in this test.
+ run_make -O -e IGNORE check
count_test_results total=15 pass=0 fail=0 error=0 \
xpass=$xpass xfail=$xfail skip=$skip
# Don't be too strict w.r.t. possible normalization of "TODO: foo" into
cat all.test # For debugging.
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=256 pass=0 fail=0 xpass=0 xfail=128 skip=128 error=0
# -------------------------------------------------------- #
ok 9
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=9 pass=9 fail=0 xpass=0 xfail=0 skip=0 error=0
:
ok 1
ok 2
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=2
grep '^ERROR: all\.test - too many tests run (expected 1, got 2)$' stdout
grep '^ERROR: all\.test 2 # UNPLANNED$' stdout
ok 2
ok 3
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=4 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=2
grep '^ERROR: all\.test - too many tests run (expected 2, got 3)$' stdout
grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=22 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=21
echo 'PASS: all.test 1' > exp
$x
1..2
END
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
test $($FGREP -c ': all.test' stdout) -eq 4
$EGREP '^PASS: all\.test 1($| )' stdout
$EGREP '^SKIP: all\.test 2($| )' stdout
. tap-setup.sh
-# Don't care about exit status or number of test results, they should be
-# checked for in many other tests.
-$MAKE check >stdout || :
-cat stdout
+# We don't care about exit status or number of test results, they
+# should be checked for in many other tests.
+run_make -O -e FAIL check
LC_ALL=C sort exp > t
mv -f t exp
ok zardoz
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
count_test_results total=7 pass=4 fail=0 xpass=0 xfail=2 skip=1 error=0
grep '^PASS: all\.test 1 foo$' stdout
chmod a+x foo bar.test baz.sh
$MAKE check-autodefs
-st=0; $MAKE check >stdout || st=$?
-cat stdout
+run_make -O -e IGNORE check
cat test-suite.log
cat foo.log
cat bar.log
cat baz.log
-test $st -eq 0 || exit 1
+test $am_make_rc_got -eq 0
count_test_results total=3 pass=1 fail=0 skip=1 xfail=1 xpass=0 error=0
:
do_recheck ()
{
case $* in
- --fail) on_bad_rc='&&';;
- --pass) on_bad_rc='||';;
+ --fail) status=FAIL;;
+ --pass) status=0;;
*) fatal_ "invalid usage of function 'do_recheck'";;
esac
rm -f *.run
- eval "\$MAKE recheck >stdout $on_bad_rc { cat stdout; ls -l; exit 1; }; :"
- cat stdout; ls -l
+ run_make -O -e $status recheck || { ls -l; exit 1; }
+ ls -l
}
for vpath in : false; do
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
: Run the tests for the first time.
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
ls -l
# All the test scripts should have run.
test -f a.run
$srcdir/configure
- $MAKE check >stdout && { cat stdout; cat test-suite.log; exit 1; }
- cat stdout
+ run_make -O -e FAIL check || { cat test-suite.log; exit 1; }
cat test-suite.log
# Couple of sanity checks. These might need to be updated if the
# 'trivial-test-driver' script is changed.
./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
test $(grep -c '^PASS:' stdout) -eq 3
test $(grep -c '^XFAIL:' stdout) -eq 13
cd $dir
cp pass.test x1.test
cp x2.test pass.test
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
test "$(cat pass.trs)" = ":test-result: FAIL"
test "$(cat x1.trs)" = ":test-result: XPASS"
test "$(cat x2.trs)" = ":test-result: XFAIL"
rm -f *.log
-VERBOSE=yes $MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check VERBOSE=yes
cat global.log
test ! -e my.log
test ! -e test-suite.log
mk_check ()
{
- st=0
- $MAKE check >stdout || st=$?
- cat stdout
+ stat=0
+ case $1 in
+ -e) stat=$2; shift 2;;
+ esac
+ run_make -O -e $stat -- check
# Our dummy driver make no testsuite progress report.
grep ': .*\.test' stdout && exit 1
# Nor it writes to the log files.
test -s foo.log && exit 1
test -s bar.log && exit 1
- return $st
+ : For 'set -e'.
}
# This must be different from the one defined in 'test/defs', as that
:test-result: SKIP
:test-global-result: ERROR
END
-mk_check && exit 1
+mk_check -e FAIL
count_test_results total=2 pass=0 fail=1 xpass=0 xfail=0 skip=1 error=0
cat > foo.test <<END
cat > bar.test <<END
:test-global-result: PASS
END
-mk_check && exit 1
+mk_check -e FAIL
count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0
cat > foo.test <<END
:test-result: ERROR
END
: > bar.test
-mk_check && exit 1
+mk_check -e FAIL
count_test_results total=6 pass=1 fail=1 xpass=1 xfail=1 skip=1 error=1
cp foo.test bar.test
-mk_check && exit 1
+mk_check -e FAIL
count_test_results total=12 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=2
# Check that we are liberal w.r.t. whitespace use.
done
cat foo.test # For debugging.
cat bar.test # Likewise.
-mk_check && exit 1
+mk_check -e FAIL
count_test_results total=30 pass=5 fail=5 xpass=5 xfail=5 skip=5 error=5
:
./configure
-$MAKE check >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M check
test -f ok.log
grep '^PASS: ok\.test' output
$FGREP 'zardoz.log' output
$MAKE check
rm -f zardoz.test
-$MAKE check >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL check
$FGREP 'zardoz.log' output
test ! -e test-suite.log
test ! -e foobar2.log || exit 99
test ! -e foobar2.trs || exit 99
-$MAKE check >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -e FAIL -M check
grep 'test-suite\.log.*foobar1\.log' output
grep 'test-suite\.log.*foobar1\.trs' output
grep 'test-suite\.log.*foobar2\.log' output
: Recreate by hand, with a failing test.
rm -f foo.trs bar.trs
-TEST_STATUS=1 $MAKE bar.trs baz.trs >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O TEST_STATUS=1 bar.trs baz.trs
test ! -e foo.trs
test -f bar.trs
test -f baz.trs
: ensure that also up-to-date '.trs' files are remade -- this time we
: grep the "make check" output verify that.
rm -f foo.trs bar.trs
-TEST_STATUS=1 $MAKE check >stdout && { cat stdout; exit 1; }
+run_make -O -e FAIL TEST_STATUS=1 check
test -f foo.trs
test -f bar.trs
grep '^FAIL: foo\.test' stdout
: Interactions with "make recheck" are OK.
rm -f foo.trs bar.trs baz.log baz.trs
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
test -f foo.trs
test -f bar.trs
test ! -e baz.trs
: '.trs' files are *not* remade.
update_stamp
rm -f foo.trs bar.trs test-suite.log
-$MAKE test-suite.log >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O test-suite.log
grep '^PASS: foo\.test' stdout
grep '^PASS: bar\.test' stdout
grep 'baz\.test' stdout && exit 1
: Again, but using "make recheck" this time.
rm -f foo.trs
chmod a-r bar.trs
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
test -f foo.trs
test -r foo.trs
test -f bar.trs
: Recreate by remaking the global test log.
chmod a-r foo.trs
rm -f test-suite.log
-$MAKE test-suite.log >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O test-suite.log
test -f foo.trs
test -r foo.trs
grep '^PASS: foo\.test' stdout
./configure
-($MAKE check || : > make.fail) | tee stdout
+($MAKE check || touch make.fail) | tee stdout
test -f make.fail
$PERL extract-testsuite-summary.pl stdout > summary.got
../configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
grep '^See \./my_test_suite\.log$' stdout
mkdir bar
$AUTOMAKE
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
grep '^See sub/test-suite\.log$' stdout
cd sub
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
grep '^See sub/test-suite\.log$' stdout
cd ..