tests: avoid '$MAKE' redirections, use 'run_make' instead
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 23 May 2013 10:10:18 +0000 (12:10 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 23 May 2013 18:09:29 +0000 (20:09 +0200)
The use 'run_make' with  the -E, -O and -M option, it is more
idiomatic now.  Also, this way, centralized fixes and improvements
done in 'run_make' will automatically propagate through most of
the testsuite.

* syntax-checks.mk (sc_tests_no_run_make_redirect): Also check against
'$MAKE' invocations that uses output redirections (and not only against
'run_make' invocation that do so).
* Several tests: Adjust (and few minor cosmetic changes as well, while
at it).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
146 files changed:
syntax-checks.mk
t/aclocal-amflags.sh
t/aclocal-autoconf-version-check.sh
t/alpha.sh
t/autohdr-subdir-pr12495.sh
t/ax/depcomp.sh
t/built-sources-check.sh
t/built-sources-fork-bomb.sh
t/ccnoco3.sh
t/check-fd-redirect.sh
t/check-tests-in-builddir.sh
t/check10.sh
t/check2.sh
t/check4.sh
t/check8.sh
t/colon6.sh
t/color-tests2.sh
t/cond34.sh
t/cond37.sh
t/cond39.sh
t/conff.sh
t/conffile-leading-dot.sh
t/cscope.tap
t/dejagnu3.sh
t/deleted-am.sh
t/deleted-m4.sh
t/dist-missing-am.sh
t/dist-missing-included-m4.sh
t/dist-missing-m4.sh
t/distcheck-configure-flags-am.sh
t/distcheck-configure-flags-subpkg.sh
t/distcheck-configure-flags.sh
t/distcheck-missing-m4.sh
t/distcheck-outdated-m4.sh
t/distcheck-pr10470.sh
t/distcheck-pr9579.sh
t/distcleancheck.sh
t/distlinksbrk.sh
t/extra-deps-lt.sh
t/extra-deps.sh
t/fn99.sh
t/fn99subdir.sh
t/gnits2.sh
t/gnits3.sh
t/install-info-dir.sh
t/libtool7.sh
t/lisp7.sh
t/lisp8.sh
t/ltorder.sh
t/make-is-gnu.sh
t/maken3.sh
t/output7.sh
t/parallel-tests-basics.sh
t/parallel-tests-concurrency.sh
t/parallel-tests-console-output.sh
t/parallel-tests-dry-run-2.sh
t/parallel-tests-empty.sh
t/parallel-tests-extra-programs.sh
t/parallel-tests-fd-redirect-exeext.sh
t/parallel-tests-fd-redirect.sh
t/parallel-tests-log-override-recheck.sh
t/parallel-tests-no-spurious-summary.sh
t/parallel-tests-recheck-depends-on-all.sh
t/parallel-tests-recheck-pr11791.sh
t/parallel-tests-recheck.sh
t/parallel-tests-reset-term.sh
t/pluseq10.sh
t/posixsubst-tests.sh
t/pr300-ltlib.sh
t/remake-aclocal-version-mismatch.sh
t/remake-subdir3.sh
t/self-check-shell-no-trail-bslash.sh
t/silent-c.sh
t/silent-custom.sh
t/silent-cxx.sh
t/silent-f77.sh
t/silent-f90.sh
t/silent-gen.sh
t/silent-lex.sh
t/silent-lt.sh
t/silent-many-languages.sh
t/silent-nested-vars.sh
t/silent-texi.sh
t/silent-yacc-headers.sh
t/silent-yacc.sh
t/subobj9.sh
t/tap-ambiguous-directive.sh
t/tap-bad-prog.tap
t/tap-bailout-suppress-badexit.sh
t/tap-bailout-suppress-later-diagnostic.sh
t/tap-basic.sh
t/tap-deps.sh
t/tap-diagnostic-custom.sh
t/tap-diagnostic.sh
t/tap-doc.sh
t/tap-doc2.sh
t/tap-empty-diagnostic.sh
t/tap-empty.sh
t/tap-escape-directive-2.sh
t/tap-escape-directive.sh
t/tap-exit.sh
t/tap-fancy.sh
t/tap-fancy2.sh
t/tap-log.sh
t/tap-merge-stdout-stderr.sh
t/tap-missing-plan-and-bad-exit.sh
t/tap-more2.sh
t/tap-msg0-directive.sh
t/tap-msg0-misc.sh
t/tap-msg0-result.sh
t/tap-negative-numbers.sh
t/tap-no-disable-hard-error.sh
t/tap-no-merge-stdout-stderr.sh
t/tap-no-spurious-numbers.sh
t/tap-no-spurious-summary.sh
t/tap-no-spurious.sh
t/tap-not-ok-skip.sh
t/tap-number-wordboundary.sh
t/tap-numbers-leading-zero.sh
t/tap-numeric-description.sh
t/tap-plan-errors.sh
t/tap-planskip-badexit.sh
t/tap-planskip-bailout.sh
t/tap-planskip-later-errors.sh
t/tap-planskip-unplanned.sh
t/tap-recheck.sh
t/tap-result-comment.sh
t/tap-signal.tap
t/tap-todo-skip-together.sh
t/tap-todo-skip-whitespace.sh
t/tap-todo-skip.sh
t/tap-unplanned.sh
t/tap-whitespace-normalization.sh
t/tap-with-and-without-number.sh
t/test-driver-acsubst.sh
t/test-driver-custom-multitest-recheck.sh
t/test-driver-custom-multitest.sh
t/test-driver-custom-xfail-tests.sh
t/test-log.sh
t/test-metadata-results.sh
t/test-missing.sh
t/test-missing2.sh
t/test-trs-recover.sh
t/test-trs-recover2.sh
t/testsuite-summary-count-many.sh
t/testsuite-summary-reference-log.sh

index 6fb119788df57133ae47a1f6bc0b999ed02dd4be..99e88f6b1c3661ba69fa0f2ab18f74db05505852 100644 (file)
@@ -342,9 +342,11 @@ sc_tests_no_source_defs:
 
 ## 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
 
index c712d96001908a2d4474c3c41a5114a6d48131f1..c0903b4f9c0e30103f71318678a387aa5398a0ea 100644 (file)
@@ -57,8 +57,7 @@ $sleep
 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
index 29aee30ccf3a1c1fcbaa222598f64841488a705f..64910d04acb2a30f3c930b591d6a5598c3b8af63 100644 (file)
@@ -43,8 +43,7 @@ sed 's/^dnl!! //' < configure.ac > configure.tmp
 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
 
index 5f01629b90a2dcf9fd7a7bd3a0615c06104af766..bbcc14b94d88b409eb2fc9be93f16953ab946cbb 100644 (file)
@@ -60,11 +60,12 @@ $AUTOMAKE
 ./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
+
+:
index a7a6a6bb241251816821e68e71034becbf0eb50f..7e26b46747df96552ddef44c9da4534f1b388d1a 100644 (file)
@@ -67,8 +67,7 @@ ocwd=$(pwd)
 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
index cdeaae5d6f220ce0845849a9002ff9abe3b19fed..ff0ecb6a3c6ff5f8cfb1b05cc991314e691ada1a 100644 (file)
@@ -161,8 +161,7 @@ case $depcomp_with_libtool in
     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
index e528b707dbd32bdf00d621913a394edb87e40487..9c81b0ebe598d4f549fa1233c9c373c711caedef 100644 (file)
@@ -58,8 +58,7 @@ $AUTOCONF
 $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
 
index 72dafa39c3fe2e6cff7c7ecb3f0cd5bdce7794fd..4807d357ddd50aeb3b7dcf9addd4b354cfd65840 100644 (file)
@@ -55,15 +55,12 @@ $AUTOCONF
 
 ./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
 
index 7ad5b3bc500cc782c5d72d3356a4d644aa5114fb..8e3547b511395782b18e09149709cd016881c8d7 100644 (file)
@@ -71,8 +71,7 @@ mkdir build
 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
 
 :
index 661c59aee9caa1471ee40e0feeda6d6c283263bb..80f786776f469888a9a8e3b52e635dab731bc8e4 100644 (file)
@@ -46,10 +46,7 @@ do_check ()
   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
index 1c41368a13731865ec48b447404c83c7ed4218cb..2d71f700bc582b465abb01f12a06a65aaf7f663c 100644 (file)
@@ -52,41 +52,38 @@ exit 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
index 3bb180b207bdcfef9a0f12f8529bbb41829533cf..75de991ae16c8ca85ad64e88014734674b4ceb59 100644 (file)
@@ -55,7 +55,7 @@ $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-( 
+(
   run_make -e IGNORE TESTS=pass check
   run_make -e IGNORE TESTS=fail check
   run_make -e IGNORE TESTS=skip check
index 03fa8b94133ad2fa88f6a05fdc0eeaf62e2a5eb5..835fff62f98c7cf981f846263b0b40f39be95b17 100644 (file)
@@ -51,8 +51,7 @@ $AUTOCONF
 $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
 
index dc34a386bed8e5accf62184894e7aafaf05ed1e6..42a7b0c48393de0e33bb0a6db8189bffaee520b3 100644 (file)
@@ -51,21 +51,18 @@ $AUTOMAKE --add-missing
 
 ./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
 
@@ -75,8 +72,7 @@ if using_gmake; then
   # 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
index a486147645b35f5979c2b030e398af65cc42e995..2586c0b7e6f2f9430db0b4602ec5a5b00fd3ab6c 100644 (file)
@@ -65,10 +65,7 @@ $AUTOCONF
 $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
@@ -85,8 +82,7 @@ $MAKE distclean
 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).
index bad9fad9081faade2c791b6df49d0eba9b56914d..fe3458414105f2ee653f4e57b9bac66ced42e233 100644 (file)
@@ -87,8 +87,7 @@ for vpath in : false; do
 
   # 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
 
index 09ebff96ccd6d2faf3421ffd900e5718a12a336f..6dcd2076d6e05c5faf2d657d90f184cf70583994 100644 (file)
@@ -152,6 +152,13 @@ test_no_color ()
   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
@@ -169,31 +176,21 @@ for vpath in false :; do
 
   $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
index ea78a7140ce5b6eab0d1ecac45a867bf1b7cad0f..995aab9a8ffadc2701e259d7ad0e9fd931e325f6 100644 (file)
@@ -54,22 +54,18 @@ $AUTOCONF
 $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
 
 :
index 18beca1590df673befde4a098bb80187a0252c40..429593749640006f6603a48cda0163af750a6ed1 100644 (file)
@@ -39,19 +39,15 @@ $AUTOCONF
 $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
 
 :
index 3e33d00efbf11b0b107922497692893504d7e503..819b0144425e764893d26413e44f155fe4d48804 100644 (file)
@@ -78,8 +78,7 @@ $AUTOCONF
 $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
@@ -93,8 +92,7 @@ $MAKE sure-exist
 $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
index 450d7be8ce9d03f3234c4943b3f02bbf76016d38..bebed778022fc50b1ae57623124c20d450a2181b 100644 (file)
@@ -47,11 +47,9 @@ $AUTOMAKE
 $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 ..
 
@@ -64,11 +62,9 @@ END
 $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 ..
 
@@ -81,11 +77,9 @@ END
 $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 ..
 
index 6c6e57abf8df0e22a4d1f3efa8e065348388451d..aebeea538efe6bd9ba78c05b0c37ca38fc3bc036 100644 (file)
@@ -54,8 +54,7 @@ $sleep
 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
 
 :
index 29feec2284d8c34e0c0ffcc62d45899e62bb6a58..88d498b04c8dc6188fe5495baf430b6036a2fb10 100644 (file)
@@ -105,8 +105,7 @@ test_cscope ()
   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"
index 8aac44f6c8d0b0fd6f2b6b2ae488efbcf2fc4746..576edc790d0dea4e404914683965d616822cd06c 100644 (file)
@@ -62,9 +62,8 @@ $MAKE distcheck
 
 # 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
 
 :
index 5e066b3bf84c3f548615de1678f7c3e089887254..980a27a5b64279f739ab03330c0ec3d03580f5b8 100644 (file)
@@ -36,8 +36,7 @@ $MAKE
 
 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
@@ -50,8 +49,7 @@ $AUTOMAKE Makefile
 $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
index 15ee1dee20d1493aa892ebaeadfb2ea5fa80d05b..1f4f7a96b6a44f9b01d7a8ea5f1cf890e22d2751 100644 (file)
@@ -39,8 +39,7 @@ $AUTOMAKE
 $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
@@ -54,8 +53,7 @@ $AUTOCONF
 ./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
index 86d513b8d59d1ea4be986ae26979ea583e681cd5..dd074bdd7998b1dbab9a76cf51d54bde378e3d6f 100644 (file)
@@ -54,8 +54,7 @@ for vpath in false :; do
     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
index c4c7e5ad6997641ba60a9730a99ac35c6be5bcb3..e14a38ed8d3e930ee72909f97a1ef8e44d173354 100644 (file)
@@ -56,8 +56,7 @@ for vpath in false :; do
     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
index fd8a68390eea765963465596f60b3d48736e742f..a2a8723df5dd7220ca602627ce61a5cd27b56f85 100644 (file)
@@ -58,8 +58,7 @@ for vpath in false :; do
     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
index b1fd49bed9b05dcfc311a5b0805e30cef645e764..0d9a8d5e23f3bb5f9afeed8cf5a25cf0c6a73819 100644 (file)
@@ -59,8 +59,7 @@ END
 $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"
index 24e8453eaae90b27bc4005663faad15c3319faac..4693907749f69b1259e5d87a2e0cccb942d45168 100644 (file)
@@ -74,8 +74,7 @@ $MAKE distcheck
 
 # ... 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
 
 :
index dece1c443fb35fa35985265f1593f2be725d9b36..3674e03a9ef6691646145e0ce77878d068db5173 100644 (file)
@@ -48,8 +48,7 @@ $MAKE distcheck \
   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
 
 :
index e430c621210c20166ae5afbc39bf1d99f5f8724c..ee492fdcc691fd6e875355230a6e5335dc6e2ca5 100644 (file)
@@ -74,8 +74,7 @@ check_no_spurious_error ()
 
 ./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
@@ -100,8 +99,7 @@ END
 $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
index a078f31223125e6f65620a1913267c8c2ae1b37b..84a08f464c047ed3376e0fc719b96e422206c47e 100644 (file)
@@ -79,9 +79,7 @@ AC_DEFUN([MY_ZARDOZ], [:])
 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.
@@ -121,8 +119,7 @@ AC_DEFUN([MY_FNORD], [:])
 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.
index a8e68c409a1f7a511ab8e501aa5369083c2a4d21..f6cb1601e03a7757cbc2b5956f6a2a22de6aacdb 100644 (file)
@@ -49,8 +49,7 @@ $AUTOMAKE
 ./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"
index 176e76d484d4113b3f9a0bd87ceb1ae79695c858..b822e5c6d7e37ffc878aa192740fb7e8e7404aa4 100644 (file)
@@ -54,9 +54,7 @@ $MAKE uninstall
 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
 
@@ -86,9 +84,7 @@ test -f inst/mu/share/info/dir
 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
index 5e5bb9e8ee7ced70139228264990b0021140c8be..b91d8359b84a2a4466c89f62f4296687f289b5cf 100644 (file)
@@ -62,9 +62,7 @@ mv -f t Makefile.am
 $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
 
index 825884e9334212c4472d336d197f91df45a204be..d2b3d0fb6ec9ef24621bf283c2283a031d5946b0 100644 (file)
@@ -60,9 +60,8 @@ for lnk in $lnk1 $lnk2 $lnka $lnkb; do
   $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
 
 :
index 8d4af443797d012829e2a66ae41f9d9d8f19c479..0950941419ed23396ec06a7a232a35d480ccac97 100644 (file)
@@ -68,8 +68,7 @@ $AUTOCONF
 : >foodep
 : >foodep2
 : >bardep
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
 grep 'making libfoodep' stdout
 
 rm -f bardep
index 3bd6d1d032bcc7c887fbc837d184dca34a86518b..6446b573d0151b1c3a4d8264440c7d1d6e6b3e41 100644 (file)
@@ -78,8 +78,7 @@ $AUTOCONF
 : >foodep
 : >foodep2
 : >bardep
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O
 grep 'making libfoodep' stdout
 
 rm -f foodep
index e98d0fd03087f06aa8097734c9f98e9d776b856b..c01eac14740cefdf974f4fa8b59efffa73e0c71c 100644 (file)
--- a/t/fn99.sh
+++ b/t/fn99.sh
@@ -43,8 +43,7 @@ $MAKE distcheck
   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)
 
index 9ef09eff417657455926a57b62dbddc5c3c344e3..7b11db3dbed6017f2f3822f319ba6af522e19a2e 100644 (file)
@@ -73,8 +73,7 @@ for i in 1 2 3 4 5 6 7 8 9; do
   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)
 
index 98e92e450e50d0d81a43f41ce254edd4004a15cb..b1bf5201e37b0982be0808b19b210d4c289a391a 100644 (file)
@@ -107,8 +107,9 @@ cd build
 ../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
 $MAKE all
 $MAKE test-install
-$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
-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
 
 :
index 097fe8f840eb50bd2de184d2f679d8f546623815..eb7f9a71b8811349dbf55c11f529d7ea112ced27 100644 (file)
@@ -87,8 +87,9 @@ cd build
 $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.
index 8bb740161cd5b77a714e78587ac62d979647cffe..b16824f42604e0f7243f11c1a918c581d6d8fec9 100644 (file)
@@ -118,8 +118,7 @@ echo error from install-info >&2
 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
index f08ed2b34c0c7aa82655e028a81346d3fb98179a..2a5b62b8e0b9a0a0b43593409d84343777e3cf52 100644 (file)
@@ -79,30 +79,20 @@ $AUTOCONF
 $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
 
 :
index da461ac9b94370822e9e8fed382d21cd968ef355..b58059bd27aa3aa746ae5dfcd57016c72fe567c9 100644 (file)
@@ -37,9 +37,7 @@ $AUTOCONF
 $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
index d68d467f7e25eb533aa0bb9455e296a541dc1fe2..efb785ca177569dbc148b8b34512b9658dff7762 100644 (file)
@@ -38,9 +38,10 @@ $AUTOMAKE --add-missing
 ./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
@@ -50,10 +51,12 @@ test -f am-three.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
index fe9d7bda2fc5035fc11e67f6bad7b3dc201e41b4..82ad9fc5983250cb97e1d054bb85567b40018714 100644 (file)
@@ -52,8 +52,7 @@ $AUTOMAKE --add-missing
 ./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
index 79397daacb82293ec83ffd323b5edcd0c3132a92..a4b7faab909570719a739b147cd1477c3e757bf2 100644 (file)
@@ -52,8 +52,7 @@ fi
 
 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
index ae4b21949d3a50b3274d411792707e5013e65401..171d716e75352956b9143414e27c5bf5f379a484 100644 (file)
@@ -142,8 +142,7 @@ check_targets ()
     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 ) ;;
     *)
index 8ec74bc949ca78d04849d6118e0fbe88b70a580a..d8832db129f198980219cdaa1bad09c1894f76eb 100644 (file)
@@ -63,10 +63,9 @@ $ACLOCAL
 $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
index dbd7ac8a0e92f87a2a64236cab1db05f44f10b16..1d25cbc15381f34e831b6a4865c80ebff1899d61 100644 (file)
@@ -64,8 +64,7 @@ $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
 test -f test-suite.log
 cat test-suite.log
index e20c82ed0f041157ef3d0beac94089d120c657b7..dd51225819903ecb4e4246777cc74784342ff1a2 100644 (file)
@@ -17,6 +17,9 @@
 # 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
@@ -90,6 +93,8 @@ $MAKE ${j}1 check &
 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 ..
index 2b8cebf9b2dfe9ab85d36d308d1ee7f3697c5172..ea3c15bb61e27d0cbc93c6a24cedcdd44775bbc4 100644 (file)
@@ -92,8 +92,7 @@ for vpath in : false; do
     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
index 087e22f800969b7ebc338d86a951067ec0a7adb2..efb96e1a143f561c14c112ddf8799c164f9b5bd9 100644 (file)
@@ -37,8 +37,7 @@ $AUTOCONF
 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
index 1407c5a6cbde1bb85452a022245d5b7dd3ec5072..d431bf2c783088694cb3dbcfc5505190844de8f1 100644 (file)
@@ -20,6 +20,7 @@
 # See 'parallel-tests-trailing-whitespace.sh' for a similar issue.
 
 . test-init.sh
+
 cat >> configure.ac << 'END'
 AC_OUTPUT
 END
@@ -33,10 +34,9 @@ $AUTOCONF
 $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
+:
index 03800a88d626218184d6554e07ef6d7bc129f53c..4df28adf8e4bb61706a04e8580cd5598538f41d6 100644 (file)
@@ -115,13 +115,10 @@ $AUTOMAKE -a
 #    '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
index 41f3098e616128b36c2c00d55ab46b2c0bea2aac..e4d7caa698bbd334d7e8d1c75549cf03e4284641 100644 (file)
@@ -104,12 +104,10 @@ grep '^\.test\$(EXEEXT)\.log:' Makefile || st=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
index c723203fb35928bf60ada5aba4292136024a62a9..1ccaf74bf98f918a840824d69fc48f406249467f 100644 (file)
@@ -57,11 +57,10 @@ grep '^bar\.log:.*bar' Makefile || st=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
index 2bfac7f65f6f8e6e5eb00485c8ab80722ecdf5d2..2d667acdbc5ab201813343136cb3f802c4f9a553 100644 (file)
@@ -61,8 +61,7 @@ filter_stdout ()
 }
 
 ./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
 
 using_gmake || $sleep # Required by BSD make.
 
index b7200594005c088d381aa3b1650ed311576af6f4..300d593d0c9986e4982e083af1d2040af5241f44 100644 (file)
@@ -49,13 +49,11 @@ $AUTOMAKE -a
 
 ./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
index e2c69162d9369d2dec7d4c3419665f1fc06b70f4..544e2de6a50ee85b8f157915d3274a97480e8e30 100644 (file)
@@ -63,8 +63,7 @@ $AUTOCONF
 $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
 
@@ -79,14 +78,12 @@ int main (void)
 }
 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
 
 :
index d0629f6ca34abacb1764550ba471b94fbdd2a511..cad1969bbe4e1abae6c77e310f36239a40fb8c7e 100644 (file)
@@ -38,23 +38,20 @@ $AUTOMAKE -a
 
 ./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
@@ -63,10 +60,9 @@ test -f foo.log
 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
@@ -76,14 +72,12 @@ test -f foo.trs
 $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
index c32d7f164395415ef4dfc7471b1d00f57fa21f8b..6bba9c89484d6203cf6105eb54ec4a3aa715284f 100644 (file)
@@ -55,16 +55,14 @@ $AUTOCONF
 $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
index fb737bc507e5a51f36c7a19da5ede52a6c0d8046..187a503be771647291e16d12badf593d0ad45aca 100644 (file)
@@ -41,15 +41,11 @@ chmod a+x foobar
 
 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
index e283ca7fa1f86d0fb2f4056eee54ddade46f144a..c80d23a3823b95c9e04da758f083af275a66f7e7 100644 (file)
@@ -48,8 +48,7 @@ $AUTOCONF
 $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
 
 :
index bdb7957ceb3b655e4227445122cfaf3dd58ef71b..a7617c5bcea0332444d103edbc470f3b2390ea45 100644 (file)
@@ -54,13 +54,12 @@ $AUTOCONF
 $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
 
index b3d759f4db531c3589d1a084dc702ef8c558d4a0..3994e36e8d4a4241bb4d3e970dd86c99eef32641 100644 (file)
@@ -53,8 +53,7 @@ cwd=$(pwd) || fatal_ "getting current working directory"
 
 # 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
@@ -64,8 +63,7 @@ grep 'libb.la .*-rpath .*lib/subdir' 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
index cb4086445b00b3796ae987be771eca3ecff2d3cc..6da7bad5b7bd81d91c8c5652bb611a3fdbd201b6 100644 (file)
@@ -34,13 +34,11 @@ cmp aclocal.m4 aclocal.tmp && exit 1
 
 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
 
index f1dbc54c660d9b4abfe8c03b090fcad5d84d542e..eb2851dd867a5441042c96540b769920fa0a0496 100644 (file)
@@ -37,8 +37,7 @@ $MAKE
 
 do_check ()
 {
-  $MAKE >stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O
   test $(grep -c "/missing " stdout) -eq 1
 }
 
index 905bb6da4b005295728281ba2afcccf487b42731..14ee02cdf208581756c11a2ef6f2b0b063092d26 100644 (file)
@@ -39,8 +39,7 @@ test "$($SHELL -c 'echo is  o\k')" = "is ok"
 
 $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
 
 :
index 24af8314cdce7120bea872a18e7775506d7f66b3..1614c229f0b7a35eca201d17c6a10842961a42dc 100644 (file)
@@ -64,8 +64,7 @@ for config_args in \
 
   ./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
@@ -78,8 +77,7 @@ for config_args in \
   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
index f5baa0482ad601571266a01da67ce377f5db2971..7ce3ffcc80fc49883d168f8d6e2de6ec43ec87b4 100644 (file)
@@ -69,8 +69,7 @@ do_check ()
   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
index 0ab2aa27f69641915c525a25af541cb8b74e4dd6..00203c22858a91b730f93c90b60da02fa8f43d5e 100644 (file)
@@ -71,9 +71,10 @@ $FGREP am_cv_CXX_dependencies_compiler_type configure
 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
@@ -90,8 +91,7 @@ do
   # 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
index 8d608e6d3cf3f885363cc663245924cff9c2aa0d..8197292b4da487aaf57f2b460d6a8e4cee95648e 100644 (file)
@@ -58,8 +58,7 @@ $AUTOMAKE --add-missing
 $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
@@ -80,8 +79,7 @@ $EGREP '(FC|FCLD) ' 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
index 41186c7fefaa2e13790470ca62e3f7a16def983b..f319a1a8970e58eef547640e538c7766cf8754e3 100644 (file)
@@ -58,8 +58,7 @@ $AUTOMAKE --add-missing
 $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
@@ -80,8 +79,7 @@ $EGREP '(F77|F77LD) ' 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
index 930dc58517e936d9a3a5158f04985fdba0008169..ac49f2b35e230c01e4d6eee156babbafd146a346 100644 (file)
@@ -42,22 +42,19 @@ $AUTOCONF
 # 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
@@ -65,22 +62,19 @@ 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
index 018f8a7a9831f334515853a8b29b5fc11300a3f6..fdafe944260e9c4ffaf6d82c1f63d27c4064b03e 100644 (file)
@@ -74,8 +74,7 @@ $FGREP 'bar2-bar.c' sub/Makefile.in || exit 99
 
 ./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
@@ -94,8 +93,7 @@ grep 'CCLD .*bar2' stdout
 # 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
@@ -112,8 +110,7 @@ grep 'CCLD .*bar2' stdout
 $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
@@ -126,8 +123,7 @@ $EGREP '(LEX|CC|CCLD) ' stdout && exit 1
 # 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
index dc9bf2acc8fe49b6e3acb165d90cf8796d76395e..cfbaaab7e0f503c11e644fa48eed9ec62a9d8af0 100644 (file)
@@ -67,8 +67,7 @@ for config_args in \
 
   ./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
@@ -82,8 +81,7 @@ for config_args in \
   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.
index bffbb6a49f62e862a1c6542dc316b2f8e66c4f09..505de947b7f7fa260a3e8e9d1ed272f372b72ca2 100644 (file)
@@ -30,8 +30,7 @@ do_and_check_silent_build ()
             *) 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
@@ -74,8 +73,7 @@ do_and_check_verbose_build ()
             *) rebuild=false;;
   esac
 
-  $MAKE V=1 >stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O V=1
 
   grep ' -c ' stdout
   grep ' -o ' stdout
index 7dca0569683cb65b6e06d16f9e2a089a9ba3f762..611965ea86371343a4ab6088a4063ef978a8129a 100644 (file)
@@ -116,8 +116,7 @@ grep '^checking whether \./mymake supports nested variables\.\.\. no *$' \
 $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
@@ -136,8 +135,7 @@ $EGREP 'CC|AM_V|GEN' Makefile # For debugging.
 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
index cbc6813b98753d2681301ff964b809acdab7d8ea..dc425a877c1951ed515f00c12001533e899ec13d 100644 (file)
@@ -47,11 +47,7 @@ $AUTOCONF
 ./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'.
@@ -73,8 +69,7 @@ $EGREP '(zardoz|foo)\.log|3\.14|Copyright|This is|[Oo]utput ' \
 
 # 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
index 87a8ec4518dcaaa621335f05224bd09c9b794f24..837b10e9f3fb4e5c50102b96714c3db8bc729610 100644 (file)
@@ -60,8 +60,7 @@ $FGREP '$(bar_YFLAGS)' Makefile.in
 
 ./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
@@ -78,8 +77,7 @@ grep 'CCLD  *bar' stdout
 
 # 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
@@ -94,8 +92,7 @@ grep 'updating  *bar-parse\.h' stdout
 # 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
@@ -109,8 +106,7 @@ grep 'CCLD  *bar' stdout
 
 # 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
@@ -125,8 +121,7 @@ $MAKE maintainer-clean
 
 ./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
@@ -137,8 +132,7 @@ $EGREP '(YACC|CC|CCLD) ' stdout && exit 1
 
 # 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
@@ -150,8 +144,7 @@ grep 'YACC' stdout && exit 1
 # 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
@@ -161,8 +154,7 @@ $EGREP '(YACC|CC|CCLD) ' stdout && exit 1
 
 # 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
index 5017d50692cca8aab7d6f79cd59c944c1162b846..8344b65e4590e9963ba605d1a049ef368713e534 100644 (file)
@@ -70,8 +70,7 @@ $FGREP 'bar2-bar.c' sub/Makefile.in || exit 99
 
 ./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
@@ -90,8 +89,7 @@ grep 'CCLD .*bar2' stdout
 # 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
@@ -108,8 +106,7 @@ grep 'CCLD .*bar2' stdout
 $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
@@ -122,8 +119,7 @@ $EGREP '(YACC|CC|CCLD) ' stdout && exit 1
 # 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
index 1f81e081b1a75af829a54ef875d4dd67d7fd3da7..9fe4f7ac8068b1639f2a62b1ca975e4ab9c66046 100644 (file)
@@ -73,15 +73,13 @@ export AUTOCONF AUTOMAKE
 
 # 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
index 6804e6742d72c0c209f73a6ef16b24ee082dfd70..500a4830deb171421e1183be968d5a175b102598 100644 (file)
@@ -32,9 +32,7 @@ ok 5 # SKIP SKIP
 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'
index cf1f371ea485dd5a8282f0b9acf2517a07372f34..490cd4a78be5e1a7dd12f079d734b0e4545f31c7 100644 (file)
@@ -49,13 +49,8 @@ $AUTOMAKE
 
 ./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?
 
index 1a10b8383fe944a890665098cd20a39d1d2dddeb..8f5fb15fd7c730a07267cd73547f269a7a48885a 100644 (file)
@@ -54,10 +54,9 @@ END
 
 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
 
index 3045e1d3543680fa2b51cb0926676dae2cbff756..730e461c4ab1919f4381d61f9d3c341726be0881 100644 (file)
@@ -32,11 +32,7 @@ Bail out!
 # 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
index c146088a26308a6f6ad047ad46127a27509747e4..b2b01ba307178e194e79a67b2ddee939f6f418c4 100644 (file)
@@ -80,9 +80,7 @@ $AUTOMAKE
 
 # 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
index 8de51d38835758234cb3bc8c3eac41aab1cec01f..a9446bf1f89b3bfe8208b02eb644e7b4c200efcb 100644 (file)
@@ -62,9 +62,7 @@ END
 
 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'
index 978b526adde0e3eac04344e1f6d53f2618f6df90..d49e93fd28b475595bb5ac9ad22fd6fad181ab12 100644 (file)
@@ -81,13 +81,11 @@ $AUTOMAKE
 
 ./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
 
 :
index 96b2a3dd310c83e73776b5a45217aebf69affcc1..23efdd4bafcc5ddabd280ce7ec1baf96eff02c49 100644 (file)
@@ -52,14 +52,12 @@ PASS: all.test 4 - zardoz
 # 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
@@ -86,8 +84,7 @@ ok
 #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,
@@ -107,8 +104,7 @@ ok 1
 #  ${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
index ab5503abfaf1f59301417887a40988315f53eded..ef2ab9370076c1f5f7fa846ea89fcb8e9740f465 100644 (file)
@@ -70,8 +70,7 @@ $AUTOMAKE -a
 
 ./configure
 
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O check
 
 cat > exp <<'END'
 PASS: foo.sh
index 742ae5ede2ef24ca57ba8213cb15918b75207a2a..ddac739c3318f09e5ae855d2e8c504965edfcf15 100644 (file)
@@ -83,8 +83,7 @@ case $MAKE in *\ -j*) skip_ "can't work easily with concurrent make";; esac
 # 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
index 4a6f2b1279f0a87f515b0525cabeee444472c425..68a51c1a382b462bd950e1d415f50951262f64ff 100644 (file)
@@ -30,8 +30,7 @@ ok 1$
 #   ${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
index 7943f1dcd7dc95308492fbb0dcdc191a73b12bb5..ec1e909f5a22ebe3f82a1f5d266f173725c1e447 100644 (file)
@@ -45,8 +45,7 @@ END
 
 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
index 135df29f9f18962864a09a7b6cea25940eb613b2..63caafdc407176f801e912386c95493f70980f0d 100644 (file)
@@ -37,9 +37,7 @@ not ok \\\\\\\\\\# TODO
 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
index daf766c76daf5b7cc253da739d2e88ce3cd20023..feb95d3b0f0127a20e6155157954788e00f85395 100644 (file)
@@ -27,9 +27,7 @@ ok \# TODO
 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
index 9e0937d75b62c015e39bce7eb9e81f7ac41b053b..95c194ebec486f4e68ca492d3332a432f1873333 100644 (file)
@@ -36,8 +36,7 @@ chmod a+x *.test
 
 . 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
@@ -46,8 +45,7 @@ grep '^ERROR: exit77\.test - exited with status 77$' 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
 
 :
index 724dd1bd1f7ab9b32bb698e1c62c27f7846d546a..f6e8d4c714b0e844be988bdffd8fc6dc9f0daeb0 100644 (file)
@@ -68,9 +68,7 @@ not ok!#TODO?
 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
 
 #
@@ -91,9 +89,7 @@ ok $weirdchars # SKIP
 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
@@ -118,10 +114,9 @@ ok # SKIP $bs
 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
index 1e53c2b69a36ba51baa14ab3ee7aad6896779952..c0742f16addfd11c847b569c49885717f14ccd64 100644 (file)
@@ -125,8 +125,7 @@ total=$(($total + 3))
 # 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
index d7eab8a5853dd86413eab8bbc3be28ea1c4ac0b6..d762ed717c13501c4912b4f63c94b596c1b26a20 100644 (file)
@@ -132,8 +132,7 @@ test -f global.log
 
 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
index 74f6f2e785aa52a4fae108a8a88ac9fdf8efe87e..26a16e8c83bc7fcd035d5cb5cb1315dd16a45bea 100644 (file)
@@ -40,10 +40,9 @@ echo "# foo foo foo" >&2
 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
@@ -53,9 +52,7 @@ echo ok 1
 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'.
@@ -63,6 +60,4 @@ count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
 run_make -O TEST_LOG_DRIVER_FLAGS=--no-merge check
 count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
 
-
-
 :
index 45b2413e15dcb734c3b7f019f0a76a3b7d578af4..b578e6ac9404a5e307b82153e2afb546a473c31c 100644 (file)
@@ -32,8 +32,7 @@ chmod a+x foo.test
 
 . 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
index ae159312bf4c58dd289455317388862b459da1c9..491399ec0b0e39d6dd95cad77ee8ae0cbe0a0ea7 100644 (file)
@@ -82,8 +82,7 @@ $AUTOMAKE
 ./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
 
index a735153047288bfe2c5482e04bdec7f78e39d3d0..5f06820cc21dd104b6c146092d0c588ba5c3475a 100644 (file)
@@ -28,9 +28,7 @@ not ok 2 # TODO 0
 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
index e1f48a9451dc7bc6670ce8dc853d413387d1e9a5..c5c724538871e5b798c8b8def63dd7c3f723f3ee 100644 (file)
@@ -45,9 +45,7 @@ ok 14 0.0 # SKIP 0.0
 
 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'
index cdadd4057f434582775fbb8adafaaf19e612ecea..2e0263f1f4b27ad952f15ee53b051e44ca3e2355 100644 (file)
@@ -35,9 +35,7 @@ ok 9 0 # SKIP
 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'
index 0a04fdbe5bec8ef8c177a17de96c556a022d8072..efd17dc48ade7c5f82d9b931160e084439094dd7 100644 (file)
@@ -33,9 +33,7 @@ ok -121
 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'
index 99b2f49fbd13191f2cbf5589f6f03f249de01f29..1a47b56c80ff1228ee50833207930a6e2cefa210 100644 (file)
@@ -41,9 +41,7 @@ cat > noplan.test <<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
 
 :
index 4ce486992d43ccfa4f7d55563f44550c4f029c41..1fc0da6382745af26f1145252d9573757d48e875 100644 (file)
@@ -42,10 +42,9 @@ END
 
 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
 
index 57c5ddcff3e150baaaab799086017745c999d748..95e9832c9be6f448b75a4c228e6dfc6112edf8d6 100644 (file)
@@ -91,9 +91,7 @@ grep '#.*#' all.test \
 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
 
index a3c3d716121c5fef82639b6d5eebfc86a24fb728..1831ef3cddbd728f9dd58c09980d39bd286d4481 100644 (file)
@@ -34,9 +34,7 @@ cat > all.test <<'END'
 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
index 8d4552900f230d2969f97e89b10bfeaacda42964..4d5e71ce06a73f86cf54d2391b7941e9df56485d 100644 (file)
@@ -105,9 +105,7 @@ cat all.test \
   && 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
 
 :
index 4ad1d424432e2ac8559d1ef292a98c5f6bc4c9c0..5d747ee6c6c1867b7634ae15ca90ea2e633a1156 100644 (file)
@@ -30,9 +30,7 @@ not ok - foo # SKIP
 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
 
 :
index a8e9f1c49c72c95ab0e25f32b585e442869152f1..ef21f67be125f0e4f2f9fcf75801c799e34e7971 100644 (file)
@@ -31,9 +31,7 @@ not ok 4?&%$ foo4 # TODO
 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
@@ -49,9 +47,7 @@ not ok 1!
 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
@@ -102,9 +98,7 @@ cat all.test
 # 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
 
index 32c252e681f38749b75a7fdeba524593655506fb..eeb2ee760136c38205c1b46e8718d42af192d628 100644 (file)
@@ -23,8 +23,7 @@
 
 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
index a007af588ab7996898802342d9a4ab2861f14aa8..a89edf9b04b764e33927aad0a003b23fdee0560a 100644 (file)
@@ -53,9 +53,7 @@ XPASS: all.test 9 ${x9} # TODO
 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
index bc0d0189e8fa87c7357860cc6738e98ecd4ec09a..c49a190676f08b8f131ebe77dc2b1589722fd7a3 100644 (file)
@@ -32,8 +32,7 @@ my_check ()
   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
index d02d184bd33ad722f4c9d80f4d8506ea6ab60934..1336eac9ab7d6648bc467a10e21f73fd5e026aa1 100644 (file)
@@ -38,8 +38,7 @@ END
 
 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.
index 655d1c9c1b4d8f5017a4befd379a2b59987c159d..0e6f7b155420d2de28d96ed9fa592a346cce9f47 100644 (file)
@@ -27,8 +27,7 @@ cat > all.test <<END
 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
 
index e924c135acce34a475e0d8aef5c30ef0d9243dbe..f26c14b71a3df815a755e165891eb79b83055ac1 100644 (file)
@@ -30,9 +30,7 @@ a non-TAP line
 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
 
index 07ed54435b3292a152104deb1108bd5d23df7888..f48585c6108955c119437f9c44ba1aa54f5cb4d9 100644 (file)
@@ -27,8 +27,7 @@ cat > all.test <<END
 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
 
@@ -38,8 +37,7 @@ ok 2 # SKIP
 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
 
@@ -47,8 +45,7 @@ cat > all.test <<END
 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
@@ -60,8 +57,7 @@ ok 2 # SKIP
 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
index 481f46c2d90967ba32463aa9cdff6a2d5b5ca27d..4a8bbc4cdb3f252c8031b8a76b1f7c2b2298e14a 100644 (file)
@@ -85,13 +85,13 @@ $AUTOMAKE
 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
@@ -119,8 +119,7 @@ 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
index 6c14506d0e6e9e698704d46e6fe0bcb5e4bbb3d5..0ca2d219b9b39469a788d5c4a9ae6a5bbcf4af19 100644 (file)
@@ -30,9 +30,7 @@ not ok #    TOD${tab}
 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.
index 2d49389815402419b780802d5e8d815f8c81a225..27e23ab97e6922181756617e7111265515287801 100644 (file)
@@ -108,13 +108,12 @@ signal_caught ()
 
 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.
@@ -130,8 +129,7 @@ done
 
 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 \
index c9a339ee1fc22423ad5c80b97252a1addcbf7ad8..a7d052cc191bb98e71896bffa13efa823acf55bb 100644 (file)
@@ -28,9 +28,7 @@ ok 1 # SKIP TODO
 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
index c4c47d9168b698a72bc30211e0f0880d0a74d582..55e4b8ff9195b1e58705c4d3fdf9f09f89cfb02e 100644 (file)
@@ -68,8 +68,8 @@ my_make_check ()
     *) 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
index 7cbb17047f32414f05674eb44f02b9eef74c7c1e..4a68416393b4baf8daa50845f9205f11eeb38671 100644 (file)
@@ -60,9 +60,7 @@ done; done; done; done; done >> all.test
 
 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
 
 # -------------------------------------------------------- #
@@ -82,9 +80,7 @@ ok 8 - SKIP
 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
 
 :
index b9d50c56937986f80a90888c235bf1c261a31bc0..c6521b038b7a63902e4e053be82b88208a8729ba 100644 (file)
@@ -26,8 +26,7 @@ cat > all.test <<END
 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
@@ -38,8 +37,7 @@ ok 1
 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
@@ -119,8 +117,7 @@ cat > t <<END
 
 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
@@ -145,8 +142,7 @@ for x in 'ok' 'ok 3' 'not ok' 'not ok # TODO' 'ok # TODO' 'ok # SKIP'; do
     $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
index 8ed7328034dc0494848ad074efa69332cb885cdf..65bc2fe16bc481d762680498b8556a902d1c3be9 100644 (file)
@@ -146,10 +146,9 @@ chmod a+x *.test
 
 . 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
index 87e4872a2496695857f9d893e471ad097322eb05..6b3b2242318a741de08dde80bb2fc6a0e04ccfa5 100644 (file)
@@ -34,8 +34,7 @@ ok 6 # SKIP
 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
index 2e70dfd09920817f01b7636532358df6e9dd0cc1..85113a4697787baf21f92c5da7924e81e8c8bb0f 100644 (file)
@@ -75,13 +75,12 @@ END
 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
 
 :
index 148553f0a5bfed0aa5931dd69d50c97ee0a72da0..f814ee52910e4f9c34c84efef78b780df838d2b3 100644 (file)
@@ -86,13 +86,13 @@ $AUTOMAKE
 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
@@ -121,8 +121,7 @@ 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
index 868eab0bda3918afa18916b8172d7f87b9736eef..2908a23d9262c9bb13d6280c12390521d8da4206 100644 (file)
@@ -119,8 +119,7 @@ for vpath in : false; do
 
   $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.
index 6ecb8968d0e6b429af9a7b8a07d90f728d862578..a7828c0b7a2f22bd69d81bf339d18745a2702dc7 100644 (file)
@@ -141,8 +141,7 @@ $AUTOMAKE
 
 ./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
 
@@ -150,8 +149,7 @@ for dir in sub1 sub2; do
   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"
index f0da927a02fe6027ae4b045d4500b449f43e04f4..fd54d6a2bc1019cd0291ce831658ace93a868d79 100644 (file)
@@ -146,8 +146,7 @@ test -f global.log
 
 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
index f0a19dc6df4522b3d789aecbc11f383173cd3b5a..9fc065e7266e0bd9e433dd11bb98563e07e4cec2 100644 (file)
@@ -49,15 +49,17 @@ chmod a+x dummy-driver
 
 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
@@ -99,7 +101,7 @@ cat > bar.test <<END
 :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
@@ -118,7 +120,7 @@ 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
@@ -147,11 +149,11 @@ 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.
@@ -169,7 +171,7 @@ END
 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
 
 :
index a58817fe8ab07460d20cff8a56593c02b1880e9e..1c7df041a04942add8a5417e7083d14bf543fe09 100644 (file)
@@ -37,8 +37,7 @@ $AUTOMAKE -a
 
 ./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
@@ -59,8 +58,7 @@ test ! -e test-suite.log
 $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
 
index 2c0e54716ea23e631f70461678867de498b6d0f5..9bc2812f72a95ef7c1e2262514d3cc8e85fcc8ab 100644 (file)
@@ -42,8 +42,7 @@ test ! -e foobar1.trs || exit 99
 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
index 7b5efdc5a3fc8c1c9e1514514e5c5a939d1237be..4585788a07c8dc3d6d565b2be4fc5d1bfc0e3f8e 100644 (file)
@@ -65,8 +65,7 @@ test ! -e baz.trs
 
 : 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
@@ -86,7 +85,7 @@ is_newest baz.trs stamp
 : 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
@@ -109,8 +108,7 @@ test ! -e baz.trs
 
 : 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
@@ -130,8 +128,7 @@ test -f 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
index b26b0e78ca4b8213cc1de7c986cd9dbbbaac5ec5..f996a5ccf1f0b496b00e95128824412defff0b5f 100644 (file)
@@ -69,8 +69,7 @@ test -r bar.trs
 : 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
@@ -81,8 +80,7 @@ grep '^PASS: bar\.test' stdout
 : 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
index 8bb34f397232bee75576157c4b918a3f09eb2f51..094b9372cb219ea271c1dc212462cf55649c66ec 100644 (file)
@@ -91,7 +91,7 @@ $AUTOCONF
 
 ./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
index 9418c0d27ecea959397a816c5fa9181572d0b36f..379f42bead1091ca393a21cdf65c9bf02602c561 100644 (file)
@@ -45,8 +45,7 @@ cd build
 
 ../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
@@ -70,12 +69,10 @@ $AUTOCONF --force
 $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 ..