tests: better idiom to override make macro defs on the cmdline
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 20 May 2013 09:23:01 +0000 (11:23 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 21 May 2013 22:05:06 +0000 (00:05 +0200)
We now do so with a new wrapper shell function 'run_make()', which
relies on the use of AM_MAKEFLAGS, avoiding the use of the '-e' make
option.  The use of that option (that causes the environment variables
to take precedence over the macro definitions in the Makefile) has
proved to be quite brittle in the past, causing annoying and sometimes
problematic spurious failures.  This has worsened in some still
unpublished work going on in development branches.  It's time to solve
the issue once and for all.

Note that we do not convert all uses of $MAKE in the testsuite right
away; we might do so in follow-up changes, with leisure, to avoid a
"patch bomb" effect (this commit is already too much of a bomb itself).
What we do in this commit is to get rid of all "$MAKE -e" invocations.

We admit that the implementation and feature-set of 'run_make()' are
far from perfect, but good enough for our current purposes.  We'll
improve 'run_make()' if and when the need arises.

* syntax-checks.mk (sc_tests_no_make_e): New syntax check, guard against
the use of "$MAKE -e".
(syntax_check_rules): Add it.
(sc_tests_overriding_macros_on_cmdline): Adjust.
(lint): New, alias for 'maintainer-check', for lazy typists.  Idea
backported from the 'maint' branch (Automake 1.13a).
* t/ax/am-test-lib.sh (run_make): New function.  Run $MAKE with the
given command-line arguments, handling command-line override of variable
definitions in a smart way (using AM_MAKEFLAGS if a non-GNU make
implementation is detected to be in use).
(useless_vpath_rebuild): Adjust to use 'run_make', to avoid a spurious
maintainer check failure.
(yl_distcheck): Use 'run_make' rather than bare '$MAKE'.
(single_quote, append_single_quoted, is_valid_varname): New auxiliary
function, used, directly or indirectly, by it.
* Many tests: Adjust to avoid the use of "$MAKE -e", and prefer the
use of 'run_make' in few other contexts as well, where it makes sense.
Other minor fixlets while at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
102 files changed:
contrib/t/parallel-tests-html.sh
syntax-checks.mk
t/ax/am-test-lib.sh
t/ax/tap-summary-aux.sh
t/ax/testsuite-summary-checks.sh
t/check-concurrency-bug9245.sh
t/check10.sh
t/check11.sh
t/check5.sh
t/check7.sh
t/color-tests.sh
t/distcheck-configure-flags.sh
t/distcheck-override-infodir.sh
t/distdir.sh
t/exeext.sh
t/instdir-java.sh
t/instdir-lisp.sh
t/instdir-ltlib.sh
t/instdir-no-empty.sh
t/instdir-prog.sh
t/instdir-python.sh
t/instdir-texi.sh
t/instdir.sh
t/instdir2.sh
t/insthook.sh
t/instmany-mans.sh
t/instmany-python.sh
t/instmany.sh
t/instspc.tap
t/javaflags.sh
t/lflags.sh
t/lflags2.sh
t/libtool9.sh
t/link_cond.sh
t/lisp-flags.sh
t/man3.sh
t/mmodely.sh
t/parallel-tests-basics.sh
t/parallel-tests-cmdline-override.sh
t/parallel-tests-empty-testlogs.sh
t/parallel-tests-exit-statuses.sh
t/parallel-tests-extra-programs.sh
t/parallel-tests-fork-bomb.sh
t/parallel-tests-harderror.sh
t/parallel-tests-log-compiler-1.sh
t/parallel-tests-log-override-1.sh
t/parallel-tests-log-override-2.sh
t/parallel-tests-log-override-recheck.sh
t/parallel-tests-no-color-in-log.sh
t/parallel-tests-recheck-pr11791.sh
t/remake-subdir-long-time.sh
t/remake-timing-bug-pr8365.sh
t/subst-no-trailing-empty-line.sh
t/suffix-custom-subobj.sh
t/suffix11.tap
t/suffix6c.sh
t/suffix8.tap
t/tap-autonumber.sh
t/tap-bailout-leading-space.sh
t/tap-bailout-suppress-later-errors.sh
t/tap-bailout.sh
t/tap-basic.sh
t/tap-color.sh
t/tap-diagnostic.sh
t/tap-doc2.sh
t/tap-global-log.sh
t/tap-global-result.sh
t/tap-log.sh
t/tap-merge-stdout-stderr.sh
t/tap-msg0-bailout.sh
t/tap-msg0-planskip.sh
t/tap-out-of-order.sh
t/tap-passthrough-exit.sh
t/tap-passthrough.sh
t/tap-plan-corner.sh
t/tap-plan-leading-zero.sh
t/tap-plan-malformed.sh
t/tap-plan-middle.sh
t/tap-plan-whitespace.sh
t/tap-plan.sh
t/tap-planskip-and-logging.sh
t/tap-planskip-case-insensitive.sh
t/tap-planskip-late.sh
t/tap-planskip-unplanned-corner.sh
t/tap-planskip-whitespace.sh
t/tap-planskip.sh
t/tap-recheck-logs.sh
t/tap-test-number-0.sh
t/tap-unplanned.sh
t/test-driver-custom-multitest-recheck2.sh
t/test-driver-custom-multitest.sh
t/test-log.sh
t/test-missing.sh
t/test-trs-basic.sh
t/test-trs-recover.sh
t/test-trs-recover2.sh
t/testsuite-summary-reference-log.sh
t/txinfo-many-output-formats-vpath.sh
t/txinfo-many-output-formats.sh
t/yflags-cmdline-override.sh
t/yflags.sh
t/yflags2.sh

index d4951b110086498299392a57b34bd6753d277a79..209dda880e87a043b928787a240d3948a689af57 100755 (executable)
@@ -87,12 +87,12 @@ test ! -e bla
 
 # Always create the HTML output, even if there were no failures.
 rm -f mylog.html
-env TESTS=foo.test $MAKE -e check-html
+run_make TESTS=foo.test check-html
 test -f mylog.html
 
 # Create summarizing HTML output also with recheck-html.
 rm -f mylog.html
-env TESTS=foo.test $MAKE -e recheck-html
+run_make TESTS=foo.test recheck-html
 test -f mylog.html
 
 # Create HTML output for an individual test.
@@ -120,7 +120,7 @@ test ! -e mylog.html
 
 $MAKE clean
 test ! -e mylog.html
-env TEST_LOGS=foo.log $MAKE -e check-html
+run_make TEST_LOGS=foo.log check-html
 test -f bla
 test -f foo.log
 test ! -e bar.log
@@ -128,7 +128,7 @@ test ! -e baz.log
 test -f mylog.html
 
 $MAKE clean
-env TESTS=foo.test $MAKE -e recheck-html
+run_make TESTS=foo.test recheck-html
 test -f bla
 test ! -e foo.log
 test -f mylog.html
index 8808ae7e31a760f376ec3843d8d2dd719d22bc1f..3feb4001e1a29fe299943900f30d0acd1994f1f2 100644 (file)
@@ -66,6 +66,7 @@ sc_tests_exit_not_Exit \
 sc_tests_automake_fails \
 sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
+sc_tests_no_make_e \
 sc_tests_plain_sleep \
 sc_tests_ls_t \
 sc_m4_am_plain_egrep_fgrep \
@@ -354,6 +355,17 @@ sc_tests_required_after_defs:
          fi; \
        done
 
+# "make -e" is brittle and unsafe, since it let *all* the environment
+# win over the macro definitions in the Makefiles.  Since we offer
+# AM_MAKEFLAGS to allow the user to portably override macro definitions
+# from the command line in a safe way, we should encourage users to use
+# it.
+sc_tests_no_make_e:
+       @if grep -E '\$$MAKE\b.* -[a-zA-Z0-9]*e' $(xtests); then \
+         echo '"make -e" is brittle, use "run_make" instead.' 1>&2; \
+         exit 1; \
+       fi
+
 ## Overriding a Makefile macro on the command line is not portable when
 ## recursive targets are used.  Better use an envvar.  SHELL is an
 ## exception, POSIX says it can't come from the environment.  V, DESTDIR,
@@ -362,11 +374,6 @@ sc_tests_required_after_defs:
 ## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
 ## ok to override it from the command line.
 sc_tests_overriding_macros_on_cmdline:
-       @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
-         echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
-         echo ' in the above lines, it is more portable.' 1>&2; \
-         exit 1; \
-       fi
 # The first s/// tries to account for usages like "$MAKE || st=$?".
 # 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
 # their definitions, hence the more complex last three substitutions below.
@@ -379,16 +386,17 @@ sc_tests_overriding_macros_on_cmdline:
                -e "s/ exp='[^']*'/ /" \
                -e 's/ exp="[^"]*"/ /' \
                -e 's/ exp=[^ ]/ /' \
-             $(xtests) | grep '\$$MAKE .*='; then \
-         echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
-         echo 'it is more portable.' 1>&2; \
+             $(filter-out %/am-test-lib.sh,$(xtests)) \
+               | grep '\$$MAKE .*='; then \
+         echo 'Rewrite "$$MAKE foo=bar" as "run_make foo=bar" in the lines above,'; \
+         echo 'it is more portable.'; \
          exit 1; \
-       fi
+       fi >&2
        @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
-         echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
-         echo 'the above lines.' 1>&2; \
+         echo '$$MAKE ignores the SHELL envvar, use "run_make SHELL=$$SHELL"'; \
+         echo 'in the above lines.'; \
          exit 1; \
-       fi
+       fi >&2
 
 ## Prefer use of our 'is_newest' auxiliary script over the more hacky
 ## idiom "test $(ls -1t new old | sed 1q) = new", which is both more
@@ -521,3 +529,8 @@ maintainer-check: $(syntax_check_rules)
 ## Check that the list of tests given in the Makefile is equal to the
 ## list of all test scripts in the Automake testsuite.
 maintainer-check: maintainer-check-list-of-tests
+
+# I'm a lazy typist.
+lint: maintainer-check
+.PHONY: lint
+
index b32320094b23864cc2b99167c819499c5b34875a..4f5c8951966f31b2934fd8526c812b3ded1bf5ee 100644 (file)
@@ -121,6 +121,127 @@ is_blocked_signal ()
   fi
 }
 
+# single_quote STRING
+# -------------------
+# Single-quote STRING for the shell, also dealing with embedded single
+# quotes. Place the result in the '$am_result', that is thus to be
+# considered public.
+single_quote ()
+{
+  am_result=$1
+  case $am_result in
+    *\'*) am_result=$(printf '%s\n' "$*" | sed -e "s/'/'\\\\''/g");;
+  esac
+  am_result="'$am_result'"
+}
+
+# append_single_quoted VARIABLE STRING
+# ------------------------------------
+append_single_quoted ()
+{
+  am__var=$1; shift
+  single_quote "$1" # Sets 'am_result'.
+  eval "${am__var}=\${$am__var:+\"\${$am__var} \"}\$am_result"
+  unset am__var am_result
+}
+
+# is_valid_varname STRING
+# -----------------------
+# Tell whether STRING is a valid name for a shell variable.  Return 0
+# if yes, return 1 if not.
+is_valid_varname ()
+{
+  # FIXME: is the below truly portable even for LC_COLLATE != "C" ?
+  case $1 in
+    [0-9]*) return 1;;
+    *[!a-zA-Z0-9_]*) return 1;;
+  esac
+  return 0
+}
+
+# run_make [-e STATUS] [--] [VAR=VAL ...] [MAKE-ARGS...]
+# ------------------------------------------------------
+# Run $MAKE with the given command-line, and fail if it doesn't exit with
+# STATUS (default: 0).  If STATUS is "FAIL", then any exit status > 0 is
+# acceptable.  If STATUS is "IGNORE", any exit value is acceptable.
+# This function also handle command-line override of variable definition
+# in a smart way, using AM_MAKEFLAGS if a non-GNU make implementation
+# is in use.
+run_make ()
+{
+  # Follow-up code might want to analyse these, so don't make them as
+  # private, nor unset them later.
+  am_make_rc_exp=0
+  am_make_rc_got=0
+  # Parse options for this function.
+  while test $# -gt 0; do
+    case $1 in
+      -e) am_make_rc_exp=$2; shift;;
+      --) shift; break;;
+       *) break;;
+    esac
+    shift
+  done
+  am__make_flags=
+  if using_gmake; then
+    # We can trust GNU make to correctly pass macro definitions given
+    # on the command line down to sub-make invocations, and this allow
+    # us to have a vary simple implementation: delegate all the work
+    # to GNU make.
+    :
+  else
+    # We have to explicitly parse arguments passed to make.  Not 100%
+    # safe w.r.t. options like '-I' that can have an argument, but
+    # should be good enough for our usages so far.
+    for am__x
+    do
+      case $am__x in
+        *=*)
+        am__maybe_var=${am__x%%=*}
+        am__maybe_val=${am__x#*=}
+        am__maybe_def="${am__maybe_var}=${am__maybe_val}"
+        # Some variables should be portably overridable from the command
+        # line, even when using non-GNU make.
+        case $am__maybe_var in
+          V|\
+          DESTDIR|\
+          SHELL|\
+          VERBOSE|\
+          DISABLE_HARD_ERRORS|\
+          DISTCHECK_CONFIGURE_FLAGS)
+            ;;
+          *)
+            if is_valid_varname "$am__maybe_var"; then
+              append_single_quoted am__make_flags "$am__maybe_def"
+            fi
+        esac
+        unset am__maybe_var am__maybe_val am__maybe_def
+        ;;
+      esac
+    done
+    unset am__x
+  fi
+  if test x"$am__make_flags" != x; then
+    $MAKE AM_MAKEFLAGS="$am__make_flags" ${1+"$@"} || am_make_rc_got=$?
+  else
+    $MAKE ${1+"$@"} || am_make_rc_got=$?
+  fi
+  unset am__make_flags
+  case $am_make_rc_exp in
+    IGNORE)
+      : Ignore exit status
+      ;;
+    FAIL)
+      test $am_make_rc_got -gt 0 || return 1
+      ;;
+    *)
+     test $am_make_rc_exp -ge 0 && test $am_make_rc_exp -le 255 \
+       || fatal_ "invalid expected exit status: '$am_make_rc_exp'"
+     test $am_make_rc_exp -eq $am_make_rc_got || return 1
+     ;;
+  esac
+}
+
 # AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
 # -----------------------------------------------------------------
 # Run automake with AUTOMAKE-ARGS, and fail if it doesn't exit with
@@ -311,7 +432,7 @@ useless_vpath_rebuild ()
         .a.b: ; cp $< $@
         baz: bar ; cp ../baz bar
 END
-    if $MAKE all && test ! -e foo.b && test ! -e bar; then
+    if run_make all && test ! -e foo.b && test ! -e bar; then
       am__useless_vpath_rebuild=no
     else
       am__useless_vpath_rebuild=yes
@@ -328,7 +449,7 @@ END
 }
 am__useless_vpath_rebuild=""
 
-yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
+yl_distcheck () { useless_vpath_rebuild || run_make distcheck ${1+"$@"}; }
 
 # count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
 # -----------------------------------------------------------------------
index 1872caa471e91580c1cc0a62d0b58417bb6dab65..2270079306cfd755891c0aad1cc5a49f2c75024b 100644 (file)
@@ -57,11 +57,11 @@ do_check ()
   if test $use_colors = yes; then
     # Forced colorization should take place also with non-ANSI terminals;
     # hence the "TERM=dumb" definition.
-    make_cmd="env TERM=dumb AM_COLOR_TESTS=always $MAKE -e"
+    make_args='TERM=dumb AM_COLOR_TESTS=always'
   else
-    make_cmd=$MAKE
+    make_args=
   fi
-  $make_cmd check > stdout || st=$?
+  run_make $make_args check > stdout || st=$?
   cat stdout
   if test $expect_failure = yes; then
     test $st -gt 0 || exit 1
index 63f3f91588b98acf2799d447af8a7cc8384d2444..94de72d7878aedb31ba2053286b5083c522c31cf 100644 (file)
@@ -69,19 +69,17 @@ do_check ()
   cat > summary.exp
   expect_failure=false
   xfail_tests=''
-  tests="TESTS='$*'"
+  tests="$*"
   for t in $*; do
     case $t in fail*|xpass*|error*) expect_failure=:;; esac
     case $t in xfail*|xpass*) xfail_tests="$xfail_tests $t";; esac
   done
-  test -z "$xfail_tests" || xfail_tests="XFAIL_TESTS='$xfail_tests'"
-  st=0
-  eval "env $tests $xfail_tests \$MAKE -e check > stdout || st=\$?"
+  run_make -e IGNORE check TESTS="$tests" XFAIL_TESTS="$xfail_tests" >stdout
   cat stdout
   if $expect_failure; then
-    test $st -gt 0 || exit 1
+    test $am_make_rc_got -gt 0 || exit 1
   else
-    test $st -eq 0 || exit 1
+    test $am_make_rc_got -eq 0 || exit 1
   fi
   $PERL "$am_testaux_srcdir"/extract-testsuite-summary.pl stdout >summary.got \
    || fatal_ "cannot extract testsuite summary"
index eaf66d97d67801361cab600d06e630b79e8e59af..abe01d3bb66064e7add5a2cce53a531647086471 100644 (file)
@@ -42,16 +42,15 @@ $AUTOMAKE -a
 
 ./configure
 
-# Some make implementations don't grok the '-j' option.
-$MAKE -j1 || exit 77
+$MAKE -j1 || skip_ "'$MAKE' doesn't support the -j option"
 
 for j in '' -j1 -j2; do
   $MAKE $j check && exit 1
-  TESTS=foo.test $MAKE $j -e check && exit 1
+  run_make -e FAIL -- $j TESTS=foo.test check
   $MAKE $j recheck && exit 1
-  TEST_LOGS=foo.log $MAKE $j -e check && exit 1
+  run_make -e FAIL -- $j TEST_LOGS=foo.log check
   rm -f test-suite.log
-  $MAKE $j test-suite.log && exit 1
+  run_make -e FAIL $j test-suite.log
   test -f test-suite.log || exit 1
 done
 
index d66ad2c7aa6a3a2657fddbdc8174f5f1e7f79559..3bb180b207bdcfef9a0f12f8529bbb41829533cf 100644 (file)
@@ -55,22 +55,19 @@ $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-(
-  # Do not check for failure in this subshell
-  set +e
-  env TESTS=pass $MAKE -e check
-  env TESTS=fail $MAKE -e check
-  env TESTS=skip $MAKE -e check
-  env TESTS=xfail $MAKE -e check
-  env TESTS=xpass $MAKE -e check
-  env TESTS="pass pass2" $MAKE -e check
-  env TESTS="fail fail2" $MAKE -e check
-  env TESTS="skip skip2" $MAKE -e check
-  env TESTS="xfail xfail2" $MAKE -e check
-  env TESTS="xpass xpass2" $MAKE -e check
-  env TESTS='pass skip xfail' $MAKE -e check
-  $MAKE check
-  :
+( 
+  run_make -e IGNORE TESTS=pass check
+  run_make -e IGNORE TESTS=fail check
+  run_make -e IGNORE TESTS=skip check
+  run_make -e IGNORE TESTS=xfail check
+  run_make -e IGNORE TESTS=xpass check
+  run_make -e IGNORE TESTS="pass pass2" check
+  run_make -e IGNORE TESTS="fail fail2" check
+  run_make -e IGNORE TESTS="skip skip2" check
+  run_make -e IGNORE TESTS="xfail xfail2" check
+  run_make -e IGNORE TESTS="xpass xpass2" check
+  run_make -e IGNORE TESTS='pass skip xfail' check
+  run_make -e IGNORE check
 ) >stdout || { cat stdout; exit 1; }
 cat stdout
 
index 61b95be03cf46c79cb61dc1c6e7b40f487d7a4a2..3526d84a73f0288a1af9054a5303c6c0cc478489 100644 (file)
@@ -40,7 +40,7 @@ $AUTOMAKE -a
 
 ./configure
 
-env TESTS=skip $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS=skip check >stdout || { cat stdout; exit 1; }
 cat stdout
 if test x"$am_serial_tests" = x"yes"; then
   grep '1.*passed' stdout && exit 1
@@ -49,7 +49,7 @@ else
   count_test_results total=1 pass=0 fail=0 skip=1 xfail=0 xpass=0 error=0
 fi
 
-env TESTS="skip skip2" $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS="skip skip2" check >stdout || { cat stdout; exit 1; }
 cat stdout
 if test x"$am_serial_tests" = x"yes"; then
   grep '2.*passed' stdout && exit 1
index 2b2d7434d4b6e6751945102144c2c9adde1921f8..a70883919c8c1333d46173dbf4e01ac80dfaeaca 100644 (file)
@@ -52,7 +52,7 @@ cp one.c two.c
 ./configure
 $MAKE check
 test -f ok
-EXEEXT=.bin $MAKE -e print-tests >stdout || { cat stdout; exit 1; }
+run_make EXEEXT=.bin print-tests >stdout || { cat stdout; exit 1; }
 cat stdout
 $FGREP 'BEG: one.bin two.bin :END' stdout
 # No am__EXEEXT_* variable is needed.
index 5f19af0d090e8d2de70eb4d6fecba0288ed6154d..5575f953f90381a351707dc2c2516d3454b8b8b1 100644 (file)
@@ -60,7 +60,7 @@ $AUTOMAKE -a
 
 ./configure
 $MAKE check
-EXEEXT=.bin $MAKE -e print-xfail-tests >stdout || {  cat stdout; exit 1; }
+run_make EXEEXT=.bin print-xfail-tests >stdout || {  cat stdout; exit 1; }
 cat stdout
 $FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
 
index ae6ef686eece35e4add22d74be79c27a5da285ca..9a0d4351f7966a5659a69615772f6cda2af34a74 100644 (file)
@@ -134,12 +134,13 @@ for vpath in false :; do
 
   # Forced colorization should take place also with non-ANSI terminals;
   # hence the "TERM=dumb" definition.
-  TERM=dumb AM_COLOR_TESTS=always $MAKE -e check >stdout \
-    && { cat stdout; exit 1; }
+  AM_COLOR_TESTS=always; export AM_COLOR_TESTS
+  run_make TERM=dumb check >stdout && { cat stdout; exit 1; }
   cat stdout
   test_color
 
-  TERM=ansi $MAKE -e check >stdout && { cat stdout; exit 1; }
+  unset AM_COLOR_TESTS
+  run_make TERM=ansi check >stdout && { cat stdout; exit 1; }
   cat stdout
   test_no_color
 
index 3c23117c7211294bc9bdc4f19a7b26def4d7f0f4..dece1c443fb35fa35985265f1593f2be725d9b36 100644 (file)
@@ -40,8 +40,9 @@ $AUTOCONF
 # It should be ok to define DISTCHECK_CONFIGURE_FLAGS either on the
 # make command line or in the environment.
 
+# Not 'make -e' below, deliberately.
 env DISTCHECK_CONFIGURE_FLAGS='--enable-success sentence=it\ works\ :-\)' \
-  $MAKE distcheck # Not 'make -e' here, deliberately.
+  $MAKE distcheck
 
 $MAKE distcheck \
   DISTCHECK_CONFIGURE_FLAGS="--enable-success=yes sentence='it works :-)'"
index cc2a5d6e805ba1dd2c29674f5939f6d5aac10ec6..6127f2bc12eafa190d63c9e00ee496f9885b0312 100644 (file)
@@ -72,7 +72,7 @@ $AUTOCONF
 $MAKE
 
 $MAKE distcheck
-infodir="$(pwd)/_info" $MAKE -e distcheck
+run_make infodir="$(pwd)/_info" distcheck
 test -f _info/dir || exit 99 # Sanity check.
 
 :
index a050d3e2a9c7f2b8e65700120f65066220ff942d..94de0d2af4574526d305a02603f7f525a3ce34eb 100644 (file)
@@ -68,7 +68,7 @@ test -d foo && exit 1
 
 rm -rf $me-1.0
 # Remove the dot from VERSION for the next grep.
-VERSION=10 MKDIR_P='echo MKDIR_P' $MAKE -e distdir >stdout || :
+run_make -e IGNORE VERSION=10 MKDIR_P='echo MKDIR_P' distdir >stdout
 cat stdout
 
 # Make sure no './' appear in the directory names.  srcdir is '..', so
index 35b1a2109a5c213d3d67137dd29410a9eade45b3..604e9a5fe37712672ab922ee392a42459c2800ff 100644 (file)
@@ -69,7 +69,7 @@ grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
 
 ./configure
 
-EXEEXT=.foo $MAKE -e print > stdout
+run_make EXEEXT=.foo print > stdout
 cat stdout
 
 grep '1BEG: maude.foo mt.foo :END1' stdout
@@ -79,7 +79,7 @@ grep '4BEG: rmt.foo :END4' stdout
 
 ./configure revert=yes
 
-EXEEXT=.foo $MAKE -e print > stdout
+run_make EXEEXT=.foo print > stdout
 cat stdout
 
 grep '1BEG: maude.foo :END1' stdout
index 97eff573ceae56802cee93a5f616921a0b18d810..547ec5f7c929d68d700218e6981426a964ee2e4d 100644 (file)
@@ -45,16 +45,16 @@ cd build
 ../configure --prefix="$instdir"
 $MAKE
 
-javadir=
-export javadir
-$MAKE -e install
+nukedirs='javadir='
+
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 0c31b81f5bf7a2c9f8b16ae8206419bba4a40d59..97605571c3cea3cb11ea442e8052366b2b779153 100644 (file)
@@ -42,17 +42,16 @@ cd build
 ../configure --prefix="$instdir"
 $MAKE
 
-lispdir=
-export lispdir
+nukedirs='lispdir='
 
-$MAKE -e install
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 32d8d409aff30a96833f7622ffd3e9c65f710eb0..0299d5a6a304cb90812da827adf5ed12367200cc 100644 (file)
@@ -69,20 +69,16 @@ cd build
              am_cv_python_pyexecdir="$instdir/pyexec"
 $MAKE
 
-bindir= libdir= pyexecdir=
-export bindir libdir pyexecdir
-$MAKE -e install
+nukedirs='bindir= libdir= pyexecdir='
+
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
+grep 'rm -f' stdout && exit 1
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 66d76f2ed940da59c8952e37d99e3d4f1188857d..03e18623dbaac10ea936f1f245b7bcb4ea3ea0c2 100644 (file)
@@ -99,7 +99,7 @@ cwd=$(pwd) || fatal_ "getting current working directory"
 
 doinst ()
 {
-  $MAKE install install-pdf install-ps install-dvi ${1+"$@"}
+  run_make install install-pdf install-ps install-dvi ${1+"$@"}
 }
 
 : > foo.sh
@@ -108,14 +108,14 @@ doinst ()
 doinst
 test ! -e inst || { find inst; exit 1; }
 $MAKE uninstall
-doinst bin_SCRIPTS=foo.sh AM_MAKEFLAGS='bin_SCRIPTS=foo.sh'
+doinst bin_SCRIPTS=foo.sh
 test -f inst/bin/foo.sh
 
 ./configure
 doinst DESTDIR="$cwd/dest"
 test ! -e dest || { find dest; exit 1; }
 $MAKE uninstall
-doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh AM_MAKEFLAGS='bin_SCRIPTS=foo.sh'
+doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
 test -f dest/usr/local/bin/foo.sh
 
 :
index 2fa14e5c359e5d5be67c08408f769a4b11ebc1c5..2c57157a9147d4ec4e1913749d85a333a1312bba 100644 (file)
@@ -68,20 +68,19 @@ cd build
              am_cv_python_pyexecdir="$instdir/pyexec"
 $MAKE
 
-bindir= libdir= pyexecdir=
-export bindir libdir pyexecdir
-$MAKE -e install
+nukedirs='bindir= libdir= pyexecdir='
+
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout \
+  || { cat stdout; exit 1; }
 cat stdout
 # Creative quoting below to please maintainer-check.
 grep 'rm'' ' stdout && exit 1
+run_make $nukedirs uninstall DESTDIR="$destdir" > stdout \
+  || { cat stdout; exit 1; }
 
 :
index 680f97ff5675b14d060da29a49ede40f0dd195b8..e431a0635f864a0d7ff3c5b25de47c0e3f022310 100644 (file)
@@ -46,17 +46,16 @@ cd build
 ../configure --prefix="$instdir"
 $MAKE
 
-pythondir=
-export pythondir
+nukedirs='pythondir='
 
-$MAKE -e install
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index fa08e3e5428fd5b54ec4222aad276fd408aae491..5cdaddbefe4117a5bf9c28d4542ce09ceb7a26e6 100644 (file)
@@ -56,18 +56,17 @@ cd build
 $MAKE all dvi ps pdf html
 ls -l
 
-infodir= htmldir= dvidir= psdir= pdfdir=
-export infodir htmldir dvidir psdir pdfdir
+nukedirs='infodir= htmldir= dvidir= psdir= pdfdir='
 
-$MAKE -e install install-html install-dvi install-ps install-pdf
+run_make $nukedirs install install-html install-dvi install-ps install-pdf
 test ! -e "$instdir"
-$MAKE -e install install-html install-dvi install-ps install-pdf \
-         DESTDIR="$destdir"
+run_make $nukedirs install install-html install-dvi install-ps install-pdf \
+                   DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 06e14ac7ef83d27a509e235803f128e885929f52..bd5915bc77c76ee1fab9a817b18f013cc166ca38 100644 (file)
@@ -55,17 +55,16 @@ cd build
 ../configure --prefix="$instdir"
 $MAKE
 
-bindir= datadir= includedir= foodir= bardir= man1dir= man2dir=
-export bindir datadir includedir foodir bardir man1dir man2dir
+nukedirs='bindir= datadir= includedir= foodir= bardir= man1dir=  man2dir='
 
-$MAKE -e install
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 834078bd7af4a3eac2821e3c6be9fe0567021f08..78a8acca020ef66a31cf8634dbd4027eff51ad8b 100644 (file)
@@ -77,17 +77,16 @@ cd build
 ../configure --prefix="$instdir"
 $MAKE
 
-bindir= datadir= includedir= foodir= bardir= man1dir= man2dir=
-export bindir datadir includedir foodir bardir man1dir man2dir
+nukedirs='bindir= datadir= includedir= foodir= bardir= man1dir=  man2dir='
 
-$MAKE -e install
+run_make $nukedirs install
 test ! -e "$instdir"
-$MAKE -e install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
 test ! -e "$instdir"
 test ! -e "$destdir"
-$MAKE -e uninstall > stdout || { cat stdout; exit 1; }
+run_make $nukedirs uninstall > stdout || { cat stdout; exit 1; }
 cat stdout
 grep 'rm -f' stdout && exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+run_make $nukedirs uninstall DESTDIR="$destdir"
 
 :
index 92840df968c510d72ecbf9d707cf18940dd3c28b..d2558e20475c6ec11bb9b9b71828f002c285b700 100644 (file)
@@ -59,7 +59,7 @@ test -f ok
 ./configure "--bindir=$(pwd)/bin"
 $MAKE install
 echo b > foo
-VERSION=2.0 $MAKE -e install
+run_make VERSION=2.0 install
 test $(cat bin/foo-1.0) = a
 test $(cat bin/foo-2.0) = b
 test $(cat bin/foo)     = b
index 2cb3ce9f89a391614da2823ef7fc6de4e002b4a4..eb0c9dbb97b5b8ad668b880bc005dc75b2cb0edb 100644 (file)
@@ -30,26 +30,35 @@ subdir=long_subdir_name_with_many_characters
 nfiles=81
 list=$(seq_ 1 $nfiles)
 
-sed "s|@limit@|$limit|g" >myinstall.in <<'END'
+oPATH=$PATH; export oPATH
+nPATH=$(pwd)/x-bin$PATH_SEPARATOR$PATH; export nPATH
+
+mkdir x-bin
+
+sed "s|@limit@|$limit|g" >x-bin/my-install <<'END'
 #! /bin/sh
 # Fake install script.  This doesn't really install
 # (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
-INSTALL='@INSTALL@'
-len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
+PATH=$oPATH; export PATH
+if test -z "$orig_INSTALL"; then
+  echo "$0: \$orig_INSTALL variable not set" >&2
+  exit 1
+fi
+len=`expr "$orig_INSTALL $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
   echo "$0: safe command line limit of $limit characters exceeded" >&2
   exit 1
 fi
-exit 0
+exec $orig_INSTALL "$@"
+exit 1
 END
 
 # Creative quoting in the next line to please maintainer-check.
-sed "s|@limit@|$limit|g" >'rm' <<'END'
+sed "s|@limit@|$limit|g" >x-bin/'rm' <<'END'
 #! /bin/sh
 limit=@limit@
-PATH=$save_PATH
-export PATH
+PATH=$oPATH; export PATH
 RM='rm -f'
 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
@@ -60,10 +69,15 @@ exec $RM "$@"
 exit 1
 END
 
-chmod +x rm
+# Creative quoting in the next line to please maintainer-check.
+chmod +x x-bin/'rm' x-bin/my-install
+
+cat > setenv.in <<'END'
+orig_INSTALL='@INSTALL@'; export orig_INSTALL
+END
 
 cat >>configure.ac <<END
-AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
+AC_CONFIG_FILES([setenv.sh:setenv.in])
 AC_CONFIG_FILES([$subdir/Makefile])
 AC_OUTPUT
 END
@@ -104,17 +118,24 @@ instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
+. ./setenv.sh
+test -n "$orig_INSTALL"
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+test -f "$instdir/share/man/man1/page1.1"
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
 test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
-INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+PATH=$nPATH; export PATH
+run_make INSTALL=my-install install
+test -f "$instdir/share/man/man1/page1.1"
+run_make INSTALL=my-install uninstall
+test $(find "$instdir" -type f -print | wc -l) -eq 0
+PATH=$oPATH; export PATH
 
 cd $subdir
 srcdir=../../$subdir
index ee8b94e037fd983653b3cab7b03347dec5296194..dfcf14bf25208800781fca74e1adc4854d8fe21e 100644 (file)
@@ -26,26 +26,35 @@ subdir=long_subdir_name_with_many_characters
 nfiles=81
 list=$(seq_ 1 $nfiles)
 
-sed "s|@limit@|$limit|g" >myinstall.in <<'END'
+oPATH=$PATH; export oPATH
+nPATH=$(pwd)/x-bin$PATH_SEPARATOR$PATH; export nPATH
+
+mkdir x-bin
+
+sed "s|@limit@|$limit|g" >x-bin/my-install <<'END'
 #! /bin/sh
 # Fake install script.  This doesn't really install
 # (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
-INSTALL='@INSTALL@'
-len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
+PATH=$oPATH; export PATH
+if test -z "$orig_INSTALL"; then
+  echo "$0: \$orig_INSTALL variable not set" >&2
+  exit 1
+fi
+len=`expr "$orig_INSTALL $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
   echo "$0: safe command line limit of $limit characters exceeded" >&2
   exit 1
 fi
-exit 0
+exec $orig_INSTALL "$@"
+exit 1
 END
 
 # Creative quoting in the next line to please maintainer-check.
-sed "s|@limit@|$limit|g" >'rm' <<'END'
+sed "s|@limit@|$limit|g" >x-bin/'rm' <<'END'
 #! /bin/sh
 limit=@limit@
-PATH=$save_PATH
-export PATH
+PATH=$oPATH; export PATH
 RM='rm -f'
 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
@@ -56,11 +65,16 @@ exec $RM "$@"
 exit 1
 END
 
-chmod +x rm
+# Creative quoting in the next line to please maintainer-check.
+chmod +x x-bin/'rm' x-bin/my-install
+
+cat > setenv.in <<'END'
+orig_INSTALL='@INSTALL@'; export orig_INSTALL
+END
 
 cat >>configure.ac <<END
 AM_PATH_PYTHON
-AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
+AC_CONFIG_FILES([setenv.sh:setenv.in])
 AC_CONFIG_FILES([$subdir/Makefile])
 AC_OUTPUT
 END
@@ -95,17 +109,24 @@ instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
+. ./setenv.sh
+test -n "$orig_INSTALL"
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+test -n "$(find "$instdir" -name python1.py)"
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
 test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
-INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+PATH=$nPATH; export PATH
+run_make INSTALL=my-install install
+test -n "$(find "$instdir" -name python1.py)"
+run_make INSTALL=my-install uninstall
+test $(find "$instdir" -type f -print | wc -l) -eq 0
+PATH=$oPATH; export PATH
 
 cd $subdir
 srcdir=../../$subdir
index 62697c56589a5facaa2a854eeb3bdda25beab5b4..0a479cc308a30b89cfc62463c30c4dabae1b4b9f 100644 (file)
@@ -38,26 +38,35 @@ subdir=long_subdir_name_with_many_characters
 nfiles=81
 list=$(seq_ 1 $nfiles)
 
-sed "s|@limit@|$limit|g" >myinstall.in <<'END'
+oPATH=$PATH; export oPATH
+nPATH=$(pwd)/x-bin$PATH_SEPARATOR$PATH; export nPATH
+
+mkdir x-bin
+
+sed "s|@limit@|$limit|g" >x-bin/my-install <<'END'
 #! /bin/sh
 # Fake install script.  This doesn't really install
 # (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
-INSTALL='@INSTALL@'
-len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
+PATH=$oPATH; export PATH
+if test -z "$orig_INSTALL"; then
+  echo "$0: \$orig_INSTALL variable not set" >&2
+  exit 1
+fi
+len=`expr "$orig_INSTALL $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
   echo "$0: safe command line limit of $limit characters exceeded" >&2
   exit 1
 fi
-exit 0
+exec $orig_INSTALL "$@"
+exit 1
 END
 
 # Creative quoting in the next line to please maintainer-check.
-sed "s|@limit@|$limit|g" >'rm' <<'END'
+sed "s|@limit@|$limit|g" >x-bin/'rm' <<'END'
 #! /bin/sh
 limit=@limit@
-PATH=$save_PATH
-export PATH
+PATH=$oPATH; export PATH
 RM='rm -f'
 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
 if test $len -ge $limit; then
@@ -68,10 +77,15 @@ exec $RM "$@"
 exit 1
 END
 
-chmod +x rm
+# Creative quoting in the next line to please maintainer-check.
+chmod +x x-bin/'rm' x-bin/my-install
+
+cat > setenv.in <<'END'
+orig_INSTALL='@INSTALL@'; export orig_INSTALL
+END
 
 cat >>configure.ac <<END
-AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
+AC_CONFIG_FILES([setenv.sh:setenv.in])
 AC_CONFIG_FILES([$subdir/Makefile])
 AC_OUTPUT
 END
@@ -118,17 +132,24 @@ instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
+. ./setenv.sh
+test -n "$orig_INSTALL"
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+test -f "$instdir/bin/script1"
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
 test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
-INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+PATH=$nPATH; export PATH
+run_make INSTALL=my-install install
+test -f "$instdir/bin/script1"
+run_make INSTALL=my-install uninstall
+test $(find "$instdir" -type f -print | wc -l) -eq 0
+PATH=$oPATH; export PATH
 
 cd $subdir
 srcdir=../../$subdir
index 5ca2b922d0d484dc81b96876da5987877ad6478a..82663562a0390c9732c75f608761cf22cba7c5f3 100644 (file)
@@ -308,7 +308,7 @@ for test_name in $test_names_list; do
     r=ok
     ../configure --prefix "/$test_string-prefix" \
       && $MAKE all \
-      && DESTDIR="$dest" file="./$test_string" $MAKE -e test-inst \
+      && DESTDIR="$dest" file="./$test_string" $MAKE test-inst \
       || r='not ok'
 
     description="$test_name in ${where}dir"
index bb9ab26a47376a23913666bbda587e7fb6d6900c..ec405d656d09eb096689b260ec6a3a150955ffeb 100644 (file)
@@ -50,7 +50,7 @@ grep '\$(JAVACFLAGS).*\$(AM_JAVACFLAGS)' Makefile.in && exit 1
 
 $AUTOCONF
 ./configure
-env JAVACFLAGS=__user_flags__ $MAKE -e
+run_make JAVACFLAGS=__user_flags__
 
 ls -l
 
index 18268b188d50ab58095edf557da1317567da7a87..ce6ccc8ded08ad450cd2eda16e2f30c5962df0df 100644 (file)
@@ -62,7 +62,7 @@ grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && exit 1
 
 $AUTOCONF
 ./configure
-env LFLAGS=__user_flags__ $MAKE -e foo.c bar-bar.c
+run_make LFLAGS=__user_flags__ foo.c bar-bar.c
 
 cat foo.c
 cat bar-bar.c
index a959aeab21e274112db2862508c69c898f6d9082..d21afad4d4a834426fd806f948babd02be1cc2a2 100644 (file)
@@ -61,7 +61,7 @@ grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && exit 1
 
 $AUTOCONF
 ./configure
-env LFLAGS=__user_flags__ $MAKE -e foo.cc bar-bar.c++
+run_make LFLAGS=__user_flags__ foo.cc bar-bar.c++
 
 cat foo.cc
 cat bar-bar.c++
index 26eb5f147afbadd93bcb61debe962f30370a8fed..9ab4d976ae1c68b287b2dfa0c6eac3a4c2fc3ce6 100644 (file)
@@ -85,9 +85,14 @@ $AUTOCONF
 $AUTOMAKE --add-missing --copy
 
 ./configure
-env LDFLAGS=ldflags AM_LDFLAGS=am_ldflags libmod1_la_LDFLAGS=lm1_la_ldflags \
-    CFLAGS=cflags AM_CFLAGS=am_cflags prg2_CFLAGS=prg2_cflags \
-    $MAKE -e print >output 2>&1 || { cat output; exit 1; }
+run_make \
+  LDFLAGS=ldflags \
+  AM_LDFLAGS=am_ldflags \
+  libmod1_la_LDFLAGS=lm1_la_ldflags \
+  CFLAGS=cflags \
+  AM_CFLAGS=am_cflags \
+  prg2_CFLAGS=prg2_cflags \
+  print >output 2>&1 || { cat output; exit 1; }
 cat output
 grep '1BEG: libmod1.la mod2.la :END1' output
 grep '2BEG: mod2.la :END2' output
index 43f06d812a0f4f26b6dc931c9f18ff8682467f6b..98b523bc34b4f7b2e23e221a776355b010822f60 100644 (file)
@@ -60,11 +60,11 @@ main ()
 END
 
 ./configure have_cxx=no
-CXX=false $MAKE -e
+run_make CXX=false
 
 # Sanity check.
 rm -f foo foo.exe
-CC=false $MAKE -e && exit 99
+run_make CC=false && exit 99
 
 $MAKE distclean
 
@@ -79,10 +79,10 @@ int main (void)
 END
 
 ./configure have_cxx=yes
-CC=false $MAKE -e
+run_make CC=false
 
 # Sanity check.
 rm -f foo foo.exe
-CXX=false $MAKE -e && exit 99
+run_make CXX=false && exit 99
 
 :
index a31bcfdf0c8f5e898b5b305c5089882ca500d789..ee156d777e80f8d2fcadc776a90983a496f69f6c 100644 (file)
 
 . test-init.sh
 
-# Don't get fooled when running as an Emacs subprocess.  This is
-# for the benefit of the "make -e" invocation below.
-unset EMACS
-
 cat > Makefile.am << 'EOF'
 lisp_LISP = foo.el
 AM_ELCFLAGS = __am_elcflags__
@@ -39,7 +35,7 @@ $AUTOMAKE --add-missing
 ./configure EMACS='echo >$@' --with-lispdir="$(pwd)/unused"
 
 : > foo.el
-ELCFLAGS='__usr_elcflags__' $MAKE -e
+run_make ELCFLAGS='__usr_elcflags__'
 grep '__am_elcflags__.*__usr_elcflags__' foo.elc
 
 :
index 24a239289825fcf62a93867bbc364ec050c4f97b..31c283298c03ccf3c729b15d0514f13b9107dfcf 100644 (file)
--- a/t/man3.sh
+++ b/t/man3.sh
@@ -39,6 +39,6 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 ./configure
-DISTCHECK_CONFIGURE_FLAGS=foo=bar $MAKE -e distcheck
+run_make DISTCHECK_CONFIGURE_FLAGS='foo=bar' distcheck
 
 :
index cb3152dd315137b064d4f34109c6306a95da3a35..42f8ca4aeaf5e26bea96777c7536f4a1497b0142 100644 (file)
@@ -87,8 +87,7 @@ PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
 # per GNU Standard.
 $MAKE maintainer-clean
 ./configure
-YACC="myyacc.sh" LEX="mylex.sh" \
-   LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
+run_make YACC=myyacc.sh LEX=mylex.sh LEX_OUTPUT_ROOT=lex.yy zardoz.c joe.c
 $FGREP zardoz.y zardoz.c
 $FGREP joe.l joe.c
 
index d86e054d7184c6024b17b13688697bed244e3130..4d0fe95025afc2257a1cb704eeef67bdcfcca3c8 100644 (file)
@@ -87,7 +87,7 @@ test ! -e test-suite.log
 # Note that this usage has a problem: the summary will only
 # take bar.log into account, because the $(TEST_SUITE_LOG) rule
 # does not "see" baz.log.  Hmm.
-env TESTS='bar.test' $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS='bar.test' check >stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^FAIL: baz\.test$' stdout
 grep '^ERROR: bar\.test$' stdout
@@ -103,7 +103,7 @@ test -f test-suite.log
 # Note that the previous test and this one taken together expose the timing
 # issue that requires the check-TESTS rule to always remove TEST_SUITE_LOG
 # before running the tests lazily.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 test -f foo.log
 grep '^PASS: foo\.test$' stdout
@@ -115,7 +115,7 @@ grep '^# ERROR: *1$' stdout
 
 # Now, explicitly retry with all test logs already updated, and ensure
 # that the summary is still displayed.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
@@ -125,7 +125,7 @@ grep '^# FAIL: *1$' stdout
 grep '^# ERROR: *1$' stdout
 
 # Lazily rerunning only foo should only rerun this one test.
-env RECHECK_LOGS=foo.log $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS=foo.log check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep foo.test stdout
 grep bar.test stdout && exit 1
@@ -135,14 +135,14 @@ grep '^# FAIL: *1$' stdout
 grep '^# ERROR: *1$' stdout
 
 $MAKE clean
-env TEST_LOGS=baz.log $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make TEST_LOGS=baz.log check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
 grep baz.test stdout
 
 $MAKE clean
-env TESTS=baz.test $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make TESTS=baz.test check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep foo.test stdout && exit 1
 grep bar.test stdout && exit 1
index ab27784bcdc5dc53ca52fcdb35b6b3e05e14f6b1..ef78c2632fc4e89885a8107d15493ff69b0f5cd3 100644 (file)
@@ -60,7 +60,7 @@ END
 
 do_check ()
 {
-  env "$@" $MAKE -e check >stdout || { cat stdout; exit 1; }
+  run_make "$@" check >stdout || { cat stdout; exit 1; }
   cat stdout
   grep '^PASS:' stdout | LC_ALL=C sort > got-out
   cat got-out
index 995b831aaa3d52a4a6213899e52aca4aa2edcb19..95b3657a7336a650387ebcc555c97154c5a63f8d 100644 (file)
@@ -80,9 +80,9 @@ for vpath in : false; do
   VERBOSE=yes $MAKE check
   no_test_has_run
   cd ../sub2
-  VERBOSE=yes TESTS='' $MAKE -e check
+  run_make VERBOSE=yes TESTS= check
   no_test_has_run
-  VERBOSE=yes TEST_LOGS='' $MAKE -e check
+  run_make VERBOSE=yes TEST_LOGS= check
   no_test_has_run
   cd ..
   $MAKE check
index d77c3b44d5f766c7547f1d8c2a6487de40e4ebd1..8612004d688b187dad6dd5206f7d914645d7fd75 100644 (file)
@@ -62,40 +62,33 @@ $AUTOMAKE -a
   for st in $failure_statuses; do
     echo "FAIL: $st"
   done
-} | LC_ALL=C sort > exp-fail
+} | LC_ALL=C sort > exp-0
 
-sed 's/^FAIL:/XFAIL:/' exp-fail | LC_ALL=C sort > exp-xfail-1
-sed '/^ERROR:/d' exp-xfail-1 > exp-xfail-2
+sed 's/^FAIL:/XFAIL:/' exp-0 | LC_ALL=C sort > exp-1
+sed '/^ERROR:/d' exp-1 > exp-2
 
-sort exp-fail
-sort exp-xfail-1
-sort exp-xfail-2
+sort exp-0
+sort exp-1
+sort exp-2
 
 ./configure
 
-st=1
-$MAKE check >stdout && st=0
-cat stdout
-cat test-suite.log
-test $st -gt 0 || exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-fail
-diff exp-fail got-fail
-
-st=1
-XFAIL_TESTS="$failure_statuses 99" $MAKE -e check >stdout && st=0
-cat stdout
-cat test-suite.log
-test $st -gt 0 || exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-1
-diff exp-xfail-1 got-xfail-1
+mk_ ()
+{
+  n=$1; shift
+  unset am_make_rc_got
+  run_make -e IGNORE ${1+"$@"} check > stdout
+  cat stdout
+  cat test-suite.log
+  LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-$n
+  diff exp-$n got-$n
+}
 
-st=0
-XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses" \
-  $MAKE -e check >stdout || st=$?
-cat stdout
-cat test-suite.log
-test $st -eq 0 || exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-2
-diff exp-xfail-2 got-xfail-2
+mk_ 0
+test $am_make_rc_got -gt 0
+mk_ 1 XFAIL_TESTS="$failure_statuses 99"
+test $am_make_rc_got -gt 0
+mk_ 2 XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses"
+test $am_make_rc_got -eq 0
 
 :
index 73e2fda650e4bf30861b339a5d2d6edc208271e5..b8d7a99de21364f371a4890f1d33e6a4491b9663 100644 (file)
@@ -158,11 +158,10 @@ $sleep
 
 echo 'int main (void) { return 0; }' > none.c
 
-st=0
-RECHECK_LOGS= $MAKE -e check >stdout || st=$?
+run_make -e IGNORE RECHECK_LOGS= check >stdout
 cat stdout
-ls -l
-test $st -eq 0 || exit 1
+ls -l # For debugging.
+test $am_make_rc_got -eq 0 || exit 1
 
 # For debugging.
 stat stamp foo.log bar.log baz.log || :
index 215294b7b95ffc740c9500256c678c15daf45d57..e63c0d7603a9676b9e2370cad0429a48991b3632 100644 (file)
@@ -100,7 +100,7 @@ do_check ()
 {
   st=0
   log=$1; shift
-  env "$@" $MAKE -e check >output 2>&1 || st=$?
+  run_make "$@" check >output 2>&1 || st=$?
   cat output
   $FGREP '::OOPS::' output && exit 1 # Possible infinite recursion.
   # Check that at least we don't create a botched global log file.
index 3563cfe52c256a008f9c93e1acaaa06fb4d3131e..26832a6551bba26f6fe54a8494e220d088ea29b5 100644 (file)
@@ -64,13 +64,12 @@ DISABLE_HARD_ERRORS=x $MAKE check
 # But an empty values for DISABLE_HARD_ERRORS means that hard errors
 # are not to be counted like normal failures.
 
-$MAKE check DISABLE_HARD_ERRORS='' && exit 1
+$MAKE check DISABLE_HARD_ERRORS= && exit 1
 cat test-suite.log
 grep '^ERROR: foo$' test-suite.log
 
 cd sub
-# The '-e' is wanted here.
-DISABLE_HARD_ERRORS='' $MAKE -e check && exit 1
+$MAKE check DISABLE_HARD_ERRORS= && exit 1
 cat test-suite.log
 grep '^ERROR: bar$' test-suite.log
 cd ..
index 6434ae92691514ea55cf41ffd87a4538ed2d1b66..fd1f1c6ae6c16d7e4c09858b7a0e66362fb3e5c3 100644 (file)
@@ -111,7 +111,7 @@ test -f bla.log
 test -f bli.suff.log
 test -f sub/test.log
 
-T_LOG_FLAGS=--bad $MAKE -e check && exit 1
+run_make -e FAIL T_LOG_FLAGS=--bad check
 cat test-suite.log
 cat bla.log
 # With the above flag overridden, bla.t should fail ...
index 46520b66e21e660c9a62de6d469fc0d4a4ad23a5..49fba566dd9370ff8d84610d73a6b9f4da354f79 100644 (file)
@@ -76,19 +76,19 @@ $MAKE clean
 test -f test-suite.log && exit 99 # Sanity check.
 
 # Check that we can override the testsuite log file at runtime.
-TEST_SUITE_LOG=zardoz.log $MAKE -e check
+run_make TEST_SUITE_LOG=zardoz.log check
 ls -l
 test ! -e test-suite.log
 cat zardoz.log
 test_log_expected zardoz.log
 # Sanity check the distribution too (this also does minimal checks on
 # VPATH support).
-TEST_SUITE_LOG=zardoz.log $MAKE -e distcheck
+run_make TEST_SUITE_LOG=zardoz.log distcheck
 
 # Check that cleanup rules remove the correct file even when
 # user overrides are in place.
 cp orig test-suite.log
-TEST_SUITE_LOG=zardoz.log $MAKE -e clean
+run_make TEST_SUITE_LOG=zardoz.log clean
 ls -l
 test ! -e zardoz.log
 diff orig test-suite.log
@@ -97,11 +97,11 @@ diff orig test-suite.log
 # Also check that the testsuite log file doesn't need to be named
 # accordingly to the '*.log' pattern.
 chmod a-w test-suite.log
-TEST_SUITE_LOG=TheLogFile $MAKE -e check
+run_make TEST_SUITE_LOG=TheLogFile check
 ls -l
 diff orig test-suite.log
 test_log_expected TheLogFile
-TEST_SUITE_LOG=TheLogFile $MAKE -e clean
+run_make TEST_SUITE_LOG=TheLogFile clean
 ls -l
 test ! -e TheLogFile
 diff orig test-suite.log
index 8accc7b26166974e3cba750b541c7708b2717a48..54e2ed92412e17b02171fe4fe6c6d5810207003c 100644 (file)
@@ -60,8 +60,8 @@ for test_list_override in \
   'TESTS=pass.test skip.test' \
   'TEST_LOGS=pass.log skip.log'
 do
-  env TEST_SUITE_LOG=partial.log "$test_list_override" \
-    $MAKE -e check >stdout || { cat stdout; exit 1; }
+  run_make TEST_SUITE_LOG=partial.log "$test_list_override" check >stdout \
+    || { cat stdout; exit 1; }
   cat stdout
   ls -l
   count_test_results total=2 pass=1 fail=0 skip=1 xfail=0 xpass=0 error=0
index d1fec7f250a59530cf870e9032a90c86ccd262fe..ff6f58262f1fada27d9201b76c540b7f0493d3fd 100644 (file)
@@ -67,7 +67,7 @@ cat stdout
 using_gmake || $sleep # Required by BSD make.
 
 chmod a-rw test-suite.log
-TEST_SUITE_LOG=my.log $MAKE -e recheck >stdout \
+run_make TEST_SUITE_LOG=my.log recheck >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 ls -l
@@ -82,7 +82,7 @@ done
 using_gmake || $sleep # Required by BSD make.
 
 chmod a-rw my.log
-BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log $MAKE -e recheck >stdout \
+run_make BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log recheck >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 ls -l
index b8a56815c4e3cb6b2852f404a05bbb79d753632a..9665016581371cc3823c571607c8667cf2f91afd 100644 (file)
@@ -45,7 +45,7 @@ $AUTOMAKE --add-missing
 
 ./configure
 mv config.log config-log # Avoid possible false positives below.
-AM_COLOR_TESTS=always $MAKE -e check && exit 1
+run_make -e FAIL AM_COLOR_TESTS=always check
 # Not a useless use of cat; see above comments "grep-nonprinting"
 # requirement in 'test-init.sh'.
 cat *.log | grep "$esc" && exit 1
index ac3a38906e522d802a096ae7c0c9c38ce2f597c1..d0629f6ca34abacb1764550ba471b94fbdd2a511 100644 (file)
@@ -14,8 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# parallel-tests: "make recheck" "make -k recheck" in the face of build
-# failures for the test cases.  See automake bug#11791.
+# parallel-tests: "make recheck" and "make -k recheck" in the face of
+# build failures for the test cases.  See automake bug#11791.
 
 required='cc native'
 . test-init.sh
@@ -42,6 +42,7 @@ $MAKE check >stdout && { cat stdout; exit 1; }
 cat stdout
 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
 # Don't trust the exit status of "make -k" for non-GNU makes.
@@ -61,6 +62,7 @@ $EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && exit 1
 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
 # Don't trust the exit status of "make -k" for non-GNU makes.
index 1cbd02e2aadb8aa266f8ac50de393e5c67fc1260..cf03335c6956521aa31f191ef08a1fe9f940ff0f 100644 (file)
@@ -93,14 +93,14 @@ rm -f automake-has-run aclocal-has-run
 
 ./configure
 # Sanity check: Makefile doesn't get updated uselessly.
-ACLOCAL=false AUTOMAKE=false AUTOCONF=false $MAKE -e
+run_make ACLOCAL=false AUTOMAKE=false AUTOCONF=false
 
 $sleep
 sed "s|magic|magic2|" configure.ac > t
 mv -f t configure.ac
 
 cd sub
-AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL" $MAKE -e Makefile
+run_make Makefile AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL"
 cd ..
 
 # For debugging.
index 662b1743e0a1a9ea001893f361fd2543b9ef8dcf..5060fd6bf48ed4b2ad965eb3c46cc1e9db7f2090 100644 (file)
@@ -98,9 +98,8 @@ END
 
 chmod a+x aclocal-wrap automake-wrap autoconf-wrap
 
-env \
-  ACLOCAL=./aclocal-wrap AUTOMAKE=./automake-wrap AUTOCONF=./autoconf-wrap \
-  $MAKE -e Makefile
+run_make Makefile \
+  ACLOCAL=./aclocal-wrap AUTOMAKE=./automake-wrap AUTOCONF=./autoconf-wrap
 grep '^FOOBAR =' Makefile.in
 grep '^FOOBAR *= *zardoz *$' Makefile
 
index 860b427d4dcbea580c84cd8547de30dd0e822cc6..3fcb1b7ace12ed3115d2d76936f0a1732949e860 100644 (file)
@@ -82,13 +82,13 @@ test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
 cat t-programs
 grep '^ *$' t-programs && exit 1
 
-$MAKE print-programs >stdout || { cat stdout; exit 1; }
+run_make print-programs >stdout || { cat stdout; exit 1; }
 cat stdout
 grep '^BEG1: x :END1$' stdout
 grep '^BEG2: :END2$' stdout
 grep '^BEG3: zardoz x :END3$' stdout
 
-am__empty=X $MAKE -e print-programs >stdout || { cat stdout; exit 1; }
+run_make am__empty=X print-programs >stdout || { cat stdout; exit 1; }
 cat stdout
 grep '^BEG1: x X :END1$' stdout
 grep '^BEG2: X :END2$' stdout
index 04d4350e2f619091d6180f73f19d06fb126a130b..6c012297bae9543b97586b4395ec16b53840d951 100644 (file)
@@ -53,7 +53,7 @@ $AUTOMAKE -a
 
 ./configure
 
-OBJEXT=quux $MAKE -e test-fake
+run_make OBJEXT=quux test-fake
 $MAKE test-real
 
 :
index 60d193be9f2597cd1692fc9b2388bfa19409c43f..5ee21af4bbc0a10faae2d1ca73a168f8fa5c1f55 100644 (file)
@@ -68,7 +68,7 @@ command_ok_ "warn about unportable make usage" \
 command_ok_ "automake" $AUTOMAKE -a -Wno-portability
 
 command_ok_ "configure"  ./configure
-command_ok_ "make test-fake" env OBJEXT=foo $MAKE -e test-fake
+command_ok_ "make test-fake" run_make OBJEXT=foo test-fake
 command_ok_ "make test-real" $MAKE test-real
 
 directive=''; make_can_chain_suffix_rules || directive=TODO
index 00c6da30c7750dce18501fac5e602fe5410dc2e9..319b6494231225296b6f2aa78dcf2e78f0a17b9c 100644 (file)
@@ -70,7 +70,7 @@ cat > foo.exp <<'END'
 %TWO%
 END
 echo %TWO% > foo.zoo
-OBJEXT=o $MAKE -e
+run_make OBJEXT=o
 cat foo.o
 cat foo.XxX
 diff foo.XxX foo.exp
@@ -82,7 +82,7 @@ cat > foo.exp <<'END'
 %THREE%
 END
 echo %THREE% > foo.zoo
-OBJEXT=obj $MAKE -e
+run_make OBJEXT=obj
 cat foo.obj
 cat foo.XxX
 diff foo.XxX foo.exp
index 7da543f61b424f43c977a69e2783b81eb821845a..12df48bf402f0efb2c8b130456f2673545479acb 100644 (file)
@@ -91,7 +91,7 @@ command_ok_ "aclocal"    $ACLOCAL
 command_ok_ "autoconf"   $AUTOCONF
 command_ok_ "automake"   $AUTOMAKE -a
 command_ok_ "configure"  protect_output ./configure
-command_ok_ "make test0" env OBJEXT=foo $MAKE -e test0
+command_ok_ "make test0" run_make OBJEXT=foo test0
 command_ok_ "make test1" $MAKE test1
 
 directive=''; make_can_chain_suffix_rules || directive=TODO
index dbefb866ac25c1f96cc1de4dff1747de3a7d046c..f1820ce86d25e00e5e8bac91dbd8dc4f079c0318 100644 (file)
@@ -44,7 +44,7 @@ not ok
 ok
 END
 
-TESTS=all.test $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS=all.test check >stdout && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=14 pass=6 fail=5 xpass=1 xfail=1 skip=1 error=0
 
index fda4b36d5642cd50fe97588b929364cf1527b463..c84c612425d958244f40e2ddc4b85893a93ba855 100644 (file)
@@ -50,7 +50,7 @@ ERROR: b.test - Bail out!
 ERROR: c.test - Bail out! FUBAR!
 END
 
-TESTS='a.test b.test c.test' $MAKE -e check >stdout \
+run_make TESTS='a.test b.test c.test' check >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 
index 936f71fb420ef706cf4a4d807979f93416c37956..7f602942c3eaf789b99df86565506c9455e07c1b 100644 (file)
@@ -52,7 +52,7 @@ ok 2
 ok 3
 END
 
-TESTS='foo.test bar.test baz.test' $MAKE -e check >stdout \
+run_make TESTS='foo.test bar.test baz.test' check >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 
index 635b7767bffff8b739049da9a6faef2efe772399..b6c0f56d129e8a89dd5f0dd79141fa69c0db61fc 100644 (file)
@@ -118,7 +118,7 @@ echo "ERROR: e.test - Bail out!" >> exp
 # Doing the sums above, we have:
 test_counts='total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5'
 
-TESTS='a.test b.test c.test d.test e.test' $MAKE -e check >stdout \
+run_make TESTS='a.test b.test c.test d.test e.test' check >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 
index 680d18d2ca8deecfd1172efc08a62b95b2757f01..5e4462b26a3cbcd406b3f1404dfc0533c4360d5b 100644 (file)
@@ -127,7 +127,7 @@ Bail out!
 ok 1
 END
 
-TESTS=bail.test $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make check TESTS=bail.test >stdout && { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
@@ -146,7 +146,7 @@ $FGREP 'success.test' stdout && exit 1
 
 rm -f *.log *.test
 
-TEST_LOGS=ok.log $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make check TEST_LOGS=ok.log >stdout || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=3 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=0
index ca2ee17271da7446dfc35a34fdb98deadfd0342b..997cb796592a50e53e91525047098c37f8412641 100644 (file)
@@ -152,13 +152,13 @@ test_no_color ()
 
 # Forced colorization should take place also with non-ANSI terminals;
 # hence the "TERM=dumb" definition.
-TERM=dumb AM_COLOR_TESTS=always $MAKE check >stdout \
-  && { cat stdout; exit 1; }
+AM_COLOR_TESTS=always; export AM_COLOR_TESTS
+run_make TERM=dumb check >stdout && { cat stdout; exit 1; }
 cat stdout
 test_color
 
-TERM=ansi $MAKE -e check >stdout \
-  && { cat stdout; exit 1; }
+unset AM_COLOR_TESTS
+run_make TERM=ansi check >stdout && { cat stdout; exit 1; }
 cat stdout
 test_no_color
 
index 7834f612674b77ac0692d29725ac85f3079ae756..59b1bda41d501ab1e3cfc248f1db6944c5303211 100644 (file)
@@ -66,7 +66,7 @@ cat got
 diff exp got
 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
 
-TEST_LOG_DRIVER_FLAGS="--no-comments" $MAKE -e check >stdout \
+run_make TEST_LOG_DRIVER_FLAGS="--no-comments" check >stdout \
   || { cat stdout; exit 1; }
 cat stdout
 $EGREP -i "#.*all\\.test|a comment|(Tests|Shell) " stdout && exit 1
index 0d4bf14dd782d109e513211a3bc92042c65ab205..55c734bd86b676584cfb99497491f27cf1cfb37f 100644 (file)
@@ -106,10 +106,10 @@ diff exp got
 
 grep '^Please report to bug-automake@gnu\.org$' stdout
 
-env \
+run_make >stdout check \
   TESTS='foo.test baz.test' \
   TEST_LOG_DRIVER_FLAGS='--comments --ignore-exit' \
-  $MAKE -e check >stdout || { cat stdout; exit 1; }
+  || { cat stdout; exit 1; }
 
 cat > exp <<'END'
 PASS: foo.test 1 - Swallows fly
index fc4a8fb7506dcd83d1dde3597f1015a10d5a79f0..b303b4ad5b9690c970c2f7337a9c21d37b8de748 100644 (file)
@@ -101,8 +101,7 @@ cat > skipall.test << 'END'
 1..0 # SKIP all
 END
 
-# We don't care about the exit status of "make check" here.
-TESTS="$(echo *.test)" $MAKE -e check || :
+run_make -e IGNORE TESTS="$(echo *.test)" check
 cat test-suite.log
 
 grep ':.*ok|not seen' test-suite.log && exit 1
index f3718d3007e9e7ee82de096c0cf84385da021486..a4a1fd1615a90eceee1bba8fc8ce4423d5ac4e7f 100644 (file)
@@ -140,7 +140,7 @@ END
 
 tests=$(echo *.test) # Also required later.
 
-TESTS="$tests" $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS="$tests" check >stdout && { cat stdout; exit 1; }
 cat stdout
 
 # Dirty trick required here.
@@ -149,7 +149,7 @@ for tst in $(echo " $tests " | sed 's/\.test / /'); do
 done
 
 rm -f test-suite.log
-TESTS="$tests" $MAKE -e test-suite.log && exit 1
+run_make -e FAIL TESTS="$tests" test-suite.log
 cat test-suite.log
 
 have_rst_section ()
index ef5429703ba5fb6f4a2969efe36267d61c537cee..d7eab8a5853dd86413eab8bbc3be28ea1c4ac0b6 100644 (file)
@@ -85,7 +85,7 @@ END
 
 chmod a+x *.test
 
-TEST_SUITE_LOG=my.log $MAKE -e check && exit 1
+run_make -e FAIL TEST_SUITE_LOG=my.log check
 ls -l # For debugging.
 test ! -e test-suite.log
 test ! -e global.log
@@ -116,7 +116,7 @@ $FGREP 'xpass.test' my.log
 $FGREP 'error.test' my.log
 
 touch error2.log test-suite.log global.log
-TEST_SUITE_LOG=my.log $MAKE -e mostlyclean
+run_make TEST_SUITE_LOG=my.log mostlyclean
 ls -l # For debugging.
 test ! -e my.log
 test ! -e pass.log
index ad954121d5b38924c8d340d83ff63792f0bf8823..ef99d8204f4993bf032fcae7095aad3893fe3d31 100644 (file)
@@ -60,7 +60,7 @@ count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
 
 # See that the option '--no-merge' can override the effect of '--merge'.
 
-TEST_LOG_DRIVER_FLAGS=--no-merge $MAKE -e check >stdout \
+run_make TEST_LOG_DRIVER_FLAGS=--no-merge check >stdout \
   || { cat stdout; exit 1; }
 cat stdout
 
index c302425224123bcd224ec25a2de9a4bc4d44825a..9e2bdcedff705fba213a55d9da75f69e9d793ba0 100644 (file)
@@ -26,7 +26,7 @@
 echo 'Bail out! 0' > a.test
 echo 'Bail out! 0.0' > b.test
 
-TESTS='a.test b.test' $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS='a.test b.test' check >stdout && { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=2
index 131d4389a473e45b3c77ca09e392481579dba8a5..3c6252d77a2a05bdf23bacab2273bf814f65f862 100644 (file)
@@ -25,7 +25,7 @@
 echo '1..0 # SKIP 0' > a.test
 echo '1..0 # SKIP 0.0' > b.test
 
-TESTS='a.test b.test' $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS='a.test b.test' check >stdout || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
index 6b98060169c651199a4957fc1564d3ccf46f3932..bac7acdb576edd1c7f99cd79b8d0f94c81db7030 100644 (file)
@@ -57,7 +57,7 @@ ok 16
 ok 17
 END
 
-TESTS='a.test b.test c.test d.test' $MAKE -e check >stdout \
+run_make TESTS='a.test b.test c.test d.test' check >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 
index fbe7e9ee27204aa35398609441ef5612ea34c555..cf9ea461404c5aee5e4e45a0fee2e404deb4575e 100644 (file)
@@ -52,7 +52,7 @@ for e in $exit_statuses; do
   done
 done
 
-env TEST_LOG_DRIVER_FLAGS='--ignore-exit' $MAKE -e check
+run_make check TEST_LOG_DRIVER_FLAGS='--ignore-exit'
 $FGREP ".test - exited with status" *.log && exit 1
 
 :
index e7c9fca56503c4e9b9b4f47fd9a52d3290fc5a35..8132f53808c4f2233f06162719357dbf3e874996 100644 (file)
@@ -46,7 +46,7 @@ ok # SKIP who cares?
 $weirdchars
 END
 
-TESTS=ok.test $MAKE -e check || { cat ok.log; exit 1; }
+run_make TESTS=ok.test check || { cat ok.log; exit 1; }
 cat ok.log
 
 for rx in \
@@ -115,8 +115,8 @@ Last line
 END
 
 st=0
-env TESTS='tiny.test ok.test ko.test bail.test skip.test err.test' \
-  $MAKE -e check || st=$?
+run_make check \
+  TESTS='tiny.test ok.test ko.test bail.test skip.test err.test' || st=$?
 cat tiny.log
 cat ok.log
 cat ko.log
index b3b81b816bcfcffaecb370ab217cfbe6746ec4ee..27f41fdbc269992edb2c9a16016977cc62ea7224 100644 (file)
@@ -36,7 +36,7 @@ ok 1
 END
 
 for pos in leading trailing; do
-  TESTS="$pos-repeated.test" $MAKE -e check >stdout \
+  run_make TESTS="$pos-repeated.test" check >stdout \
     && { cat stdout; exit 1; }
   cat stdout
   count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
@@ -59,8 +59,8 @@ ok 2
 1..2
 END
 
-env TESTS="leading-repeated.test trailing-repeated.test" \
-  $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS="leading-repeated.test trailing-repeated.test" check >stdout \
+  && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=6 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=3
 grep "^ERROR: leading-repeated\\.test - multiple test plans$" stdout
@@ -90,8 +90,8 @@ cat > 4.test <<END
 1..0 # SKIP
 END
 
-env TESTS="1.test 2.test 3.test 4.test" \
-  $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS="1.test 2.test 3.test 4.test" check >stdout \
+  && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=8 pass=0 fail=0 xpass=0 xfail=0 skip=4 error=4
 for i in 1 2 3 4; do
@@ -112,7 +112,7 @@ ok 4
 ok 5
 END
 
-$MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make check >stdout && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=8 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=3
 
@@ -143,7 +143,7 @@ ok 2
 ok 3
 END
 
-$MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make check >stdout && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=5 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=3
 
@@ -174,7 +174,7 @@ ok 4
 ok 5
 END
 
-$MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make check >stdout && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=7 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=4
 
index 3dff53e3e3413c108d4e4dda7e39050f9111d14c..00caeb4599126eca40f18aacb644d383533eb990 100644 (file)
@@ -47,8 +47,8 @@ done >> d.test
 echo 1..00 > e.test
 echo '1..000 # SKIP' > f.test
 
-env TESTS='a.test b.test c.test d.test e.test f.test' \
-  $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS='a.test b.test c.test d.test e.test f.test' check >stdout \
+  || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=115 pass=113 xfail=0 skip=2 fail=0 xpass=0 error=0
index 9d1f19e6c6600e71cec76eb81592fdaf4e6546da..e2dd7d02c32ddceca7eaca28d584d49201156f44 100644 (file)
@@ -47,7 +47,7 @@ END
 
 tests_list=$(echo *.test)
 
-TESTS="$tests_list" $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS="$tests_list" check >stdout && { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=9 pass=2 fail=0 xpass=0 xfail=2 skip=0 error=5
index 303ece5eb6e455c063c83ab5387ec4637301a133..bfc473b3fba6e2a1af2d63def42aa7c5fdd1b068 100644 (file)
@@ -73,8 +73,8 @@ END
 tests=$(echo *.test)
 
 for tap_flags in "" "--comments"; do
-  env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
-    $MAKE -e check >stdout || { cat stdout; exit 1; }
+  run_make TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" check >stdout \
+    || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
 done
index b0363c9533098e860576c77179e77e97250d452e..659a7e77a9f437cc058f30d5f3f4f7ded528d935 100644 (file)
@@ -32,7 +32,7 @@ cat > bar.test <<END
 ok 1
 END
 
-TESTS='foo.test bar.test' $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS='foo.test bar.test' check >stdout || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=3 pass=3 fail=0 error=0 xpass=0 xfail=0 skip=0
index 6a5332e17bb0deccc373a9c1332933f89125883a..50ae426052c8c35e8ebbf667e68ae4e6052bcf2c 100644 (file)
@@ -41,8 +41,8 @@ ok
 END
 
 for tap_flags in "" "--comments"; do
-  env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS='top.test bot.test' \
-    $MAKE -e check >stdout || { cat stdout; exit 1; }
+  run_make TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS='top.test bot.test' \
+    check >stdout || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=7 pass=5 xfail=1 skip=1 fail=0 xpass=0 error=0
 done
index 3c4bcb50239ea939a91db8c832942b37f0a93976..b3089e41ac09c83af98690f66ed98d00760a5756 100644 (file)
@@ -45,7 +45,7 @@ an early non-TAP line
 a later non-TAP line
 END
 
-TESTS='foo.test foo2.test bar.test' $MAKE -e check >stdout \
+run_make TESTS='foo.test foo2.test bar.test' check >stdout \
   || { cat stdout; exit 1; }
 cat stdout
 
index 8dc17571180a56c3372a5dc7f17aa482d30e3b29..54a644e52b782d6042bdcc7ca9316146fea4d440 100644 (file)
@@ -32,7 +32,7 @@ for c4 in p P; do
   echo "1..0 # $c1$c2$c3$c4 foobar" > $j.test
 done; done; done; done
 
-TESTS="$(echo *.test)" $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS="$(echo *.test)" check >stdout || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=16 pass=0 fail=0 xpass=0 xfail=0 skip=16 error=0
index 69cb9e6608020275c57ffd937f218b581fe17b51..ab3f336f56760cadf7dca492b55538d7b5b7ff05 100644 (file)
@@ -32,7 +32,7 @@ cat > bar.test <<END
 1..0
 END
 
-TESTS='foo.test bar.test' $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS='foo.test bar.test' check >stdout || { cat stdout; exit 1; }
 cat stdout
 
 grep '^SKIP: foo\.test .* from the last line$' stdout
index 1f7e7fedca37c5479caf8ef4e09e436ae5410666..21764699534f23472d4965fffc20264eb628454b 100644 (file)
@@ -32,7 +32,7 @@ ok 1 # SKIP
 1..0 # SKIP
 END
 
-TESTS='foo.test bar.test' $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TESTS='foo.test bar.test' check >stdout && { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=5 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=3
index be2437bff9359e09fe1dd74dab3bd57b1e3c4f03..9513ca2ec7ef9e14d1f38f719293cbf80a27bfa7 100644 (file)
@@ -34,7 +34,7 @@ cat > baz.test <<END
 1..0 #  SKIP${tab}  Strip${tab}external  preserve ${tab}middle  ${tab}${sp}
 END
 
-TESTS='foo.test bar.test baz.test' $MAKE -e check > stdout \
+run_make TESTS='foo.test bar.test baz.test' check > stdout \
   || { cat stdout; exit 1; }
 cat stdout
 
index bc9c0fd312688b8d4d9f91d7e1e45f3128f72b18..d0ab69272bb8ba4a80b478eabb570dc806a9faf2 100644 (file)
@@ -56,8 +56,8 @@ cat > mu.test <<END
 1..0 # SKIP $weirdchars
 END
 
-env TESTS='foo.test bar.test baz.test wget.test curl.test mu.test' \
-  $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make TESTS='foo.test bar.test baz.test wget.test curl.test mu.test' \
+  check >stdout || { cat stdout; exit 1; }
 cat stdout
 
 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=0 skip=6 error=0
index 166de6e925bcf5cbb5a417b1994454bf3d004f67..a4d52aae653eff8bf563d9202daceced6a40a95c 100644 (file)
@@ -58,14 +58,14 @@ grep_summary ()
   grep '^# ERROR: *1$' stdout
 }
 
-$MAKE -e check && exit 1
+run_make -e FAIL check
 test -f foo.log
 test -f bar.log
 test -f baz.log
 
 rm -f foo.log bar.log
 
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 test -f foo.log
 test -f bar.log
@@ -80,7 +80,7 @@ touch foo.test
 # We re-run only a successful test, but the tests that failed in the
 # previous run should still be taken into account, and cause an overall
 # failure.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^PASS: foo\.test 1$' stdout
 grep '^PASS: foo\.test 2$' stdout
@@ -90,7 +90,7 @@ grep_summary
 
 $sleep
 touch zardoz
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^ERROR: baz\.test' stdout
 $EGREP '(foo|bar)\.test' stdout && exit 1
@@ -99,7 +99,7 @@ grep_summary
 
 # Now, explicitly retry with all test logs already updated, and ensure
 # that the summary is still displayed.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check > stdout && { cat stdout; exit 1; }
 cat stdout
 $EGREP '(foo|bar|baz)\.test' stdout && exit 1
 grep_summary
@@ -107,7 +107,7 @@ grep_summary
 # The following should re-run foo.test (and only foo.test), even if its
 # log file is up-to-date.
 : > older
-env RECHECK_LOGS=foo.log $MAKE -e check > stdout && { cat stdout; exit 1; }
+run_make RECHECK_LOGS=foo.log check > stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^PASS: foo\.test 1$' stdout
 grep '^PASS: foo\.test 2$' stdout
index 03dc307249e68a4a6af2a59ff151b051b8b63aba..a42ff548bb8535dde66756f315275836cc5df526 100644 (file)
@@ -70,7 +70,7 @@ cat > e.test <<END
 ok 0 # TODO
 END
 
-TESTS='a.test b.test c.test d.test e.test' $MAKE -e check >stdout \
+run_make TESTS='a.test b.test c.test d.test e.test' check >stdout \
   && { cat stdout; exit 1; }
 cat stdout
 
index 6362335d46436a1dd7d50343deede4cedacc0fea..11b68a32e3ee86a0a9b7c52ca5ba3916e028db48 100644 (file)
@@ -53,7 +53,7 @@ ok 3
 not ok 4
 ok 5 # SKIP
 END
-XFAIL_TESTS=all.test $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make XFAIL_TESTS=all.test check >stdout && { cat stdout; exit 1; }
 cat stdout
 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=1 skip=1 error=4
 grep '^ERROR: all\.test - too many tests run (expected 2, got 5)$' stdout
index c6c0d893a4fe1c278ee79b0157a2d8bea4ebedde..0c435de2b8d6a5bbd28c94548f5b829583535967 100644 (file)
@@ -83,7 +83,7 @@ for vpath in : false; do
   $srcdir/configure
 
   : Run the tests for the first time.
-  $MAKE check >stdout && { cat stdout; exit 1; }
+  run_make check >stdout && { cat stdout; exit 1; }
   cat stdout
   # All the test scripts should have run.
   test -f a.run
@@ -95,7 +95,7 @@ for vpath in : false; do
 
   : An empty '$(TESTS)' or '$(TEST_LOGS)' means that no test should be run.
   for var in TESTS TEST_LOGS; do
-    env "$var=" $MAKE -e recheck >stdout || { cat stdout; exit 1; }
+    run_make "$var=" recheck >stdout || { cat stdout; exit 1; }
     cat stdout
     count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
     test ! -e a.run
@@ -106,7 +106,7 @@ for vpath in : false; do
 
   : a.test was successful the first time, no need to re-run it.
   using_gmake || $sleep # Required by BSD make.
-  env TESTS=a.test $MAKE -e recheck >stdout \
+  run_make TESTS=a.test recheck >stdout \
     || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
@@ -117,7 +117,7 @@ for vpath in : false; do
   : b.test failed, it should be re-run.  And make it pass this time.
   using_gmake || $sleep # Required by BSD make.
   echo OK > b.ok
-  TEST_LOGS=b.log $MAKE -e recheck >stdout \
+  run_make TEST_LOGS=b.log recheck >stdout \
     || { cat stdout; exit 1; }
   cat stdout
   test ! -e a.run
@@ -129,7 +129,7 @@ for vpath in : false; do
 
   : No need to re-run a.test or b.test anymore.
   using_gmake || $sleep # Required by BSD make.
-  TEST_LOGS=b.log $MAKE -e recheck >stdout \
+  run_make TEST_LOGS=b.log recheck >stdout \
     || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
@@ -137,7 +137,7 @@ for vpath in : false; do
   test ! -e b.run
   test ! -e c.run
   using_gmake || $sleep # Required by BSD make.
-  TESTS='a.test b.test' $MAKE -e recheck >stdout \
+  run_make TESTS='a.test b.test' recheck >stdout \
     || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
@@ -149,7 +149,7 @@ for vpath in : false; do
   : as it contained an XPASS.  And this time, make it fail with
   : an hard error.
   echo dummy > c.err
-  env TEST_LOGS='a.log c.log' $MAKE -e recheck >stdout \
+  run_make TEST_LOGS='a.log c.log' recheck >stdout \
     && { cat stdout; exit 1; }
   cat stdout
   count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
@@ -164,7 +164,7 @@ for vpath in : false; do
   # Use 'echo', not ':'; see comments above for why.
   using_gmake || $sleep # Required by BSD make.
   echo dummy > c.ok
-  env TESTS='c.test a.test' $MAKE -e recheck >stdout \
+  run_make TESTS='c.test a.test' recheck >stdout \
     || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
@@ -177,7 +177,7 @@ for vpath in : false; do
   : Nothing should be rerun anymore, as all tests have been eventually
   : successful.
   using_gmake || $sleep # Required by BSD make.
-  $MAKE recheck >stdout || { cat stdout; exit 1; }
+  run_make recheck >stdout || { cat stdout; exit 1; }
   cat stdout
   count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
   test ! -e a.run
index 5727af2e58f78522c26de057ba8cd4fa7194658e..a21174a12841a738b0d9bec17dab27c33821371c 100644 (file)
@@ -158,7 +158,7 @@ for vpath in : false; do
   grep '%% pass-xpass-fail-xfail-skip-error %%' test-suite.log
   test $(grep -c '%% ' test-suite.log) -eq 4
 
-  TESTS='pass.t pass3-skip2-xfail.t' $MAKE -e check >stdout \
+  run_make TESTS='pass.t pass3-skip2-xfail.t' check >stdout \
     || { cat stdout; cat test-suite.log; exit 1; }
   cat test-suite.log
   cat stdout
index 54b7e81c9df5736b747504c822c5da5a3e2eb49f..f0da927a02fe6027ae4b045d4500b449f43e04f4 100644 (file)
@@ -88,7 +88,7 @@ $AUTOMAKE -a
 
 ./configure
 
-TEST_SUITE_LOG=my.log $MAKE -e check && exit 1
+run_make -e FAIL TEST_SUITE_LOG=my.log check
 ls -l # For debugging.
 test ! -e test-suite.log
 test ! -e global.log
@@ -130,7 +130,7 @@ have_rst_section 'XPASS: xpass' my.log
 have_rst_section 'ERROR: error' my.log
 
 touch error2.log test-suite.log global.log
-TEST_SUITE_LOG=my.log $MAKE -e mostlyclean
+run_make TEST_SUITE_LOG=my.log mostlyclean
 ls -l # For debugging.
 test ! -e my.log
 test ! -e pass.log
index 0e46cf59301582bc376f24e1a36bc87855e65858..b3d42d929cc3f79df9f1a3088bf51841cadbde33 100644 (file)
@@ -44,13 +44,15 @@ grep '^PASS: ok\.test' output
 $FGREP 'zardoz.log' output
 test ! -e test-suite.log
 
-TESTS='zardoz2.test' $MAKE -e check >output 2>&1 \
+# FIXME: this redirection is fishy... run_make needs to be enhanced
+run_make TESTS='zardoz2.test' check >output 2>&1 \
   && { cat output; exit 1; }
 cat output
 $FGREP 'zardoz2.log' output
 test ! -e test-suite.log
 
-TEST_LOGS='zardoz3.log' $MAKE -e check >output 2>&1 \
+# FIXME: this redirection is fishy... run_make needs to be enhanced
+run_make TEST_LOGS='zardoz3.log' check >output 2>&1 \
   && { cat output; exit 1; }
 cat output
 $FGREP 'zardoz3.log' output
index 525d5bf1827fc7db712484c8ae44f1e07fe52d0c..a7f77d52fc03913eaf347fe821ebd70cad925ad9 100644 (file)
@@ -71,7 +71,7 @@ for vpath in : false; do
   test x"$(cat tb)" = x"foo bar sub/zardoz"
   rm -f tb
   # Please don't change the order of the stuff in TESTS, below.
-  TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' $MAKE -e tb
+  run_make TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' tb
   test x"$(cat tb)" = x"foo foo2 foo-log foolog a.log.b 0.exe"
   rm -f tb
 
@@ -116,18 +116,18 @@ test -f sub/foo.trs
 # Try with a subset of TESTS.
 #
 
-TESTS=foo.test $MAKE -e check
+run_make TESTS=foo.test check
 test -f foo.trs
 test ! -e bar.trs
 test ! -e sub/zardoz.trs
 $MAKE clean
 test ! -e foo.trs
-TESTS='foo.test bar.sh' $MAKE -e check
+run_make TESTS='foo.test bar.sh' check
 test -f foo.trs
 test -f bar.trs
 test ! -e sub/zardoz.trs
 # "make clean" shouldn't remove '.trs' files for tests not in $(TESTS).
-TESTS=bar.sh $MAKE -e clean
+run_make TESTS=bar.sh clean
 test -f foo.trs
 test ! -e bar.trs
 
@@ -137,19 +137,19 @@ $MAKE clean
 # Try with a subset of TEST_LOGS.
 #
 
-TEST_LOGS=sub/zardoz.log $MAKE -e check
+run_make TEST_LOGS=sub/zardoz.log check
 test ! -e foo.trs
 test ! -e bar.trs
 test -f sub/zardoz.trs
 $MAKE clean
 test ! -e sub/zardoz.trs
-TEST_LOGS='foo.log bar.log' $MAKE -e check
+run_make TEST_LOGS='foo.log bar.log' check
 test -f foo.trs
 test -f bar.trs
 test ! -e sub/zardoz.trs
 # "make clean" shouldn't remove '.trs' files for tests whose log
 # is not in $(TEST_LOGS).
-TEST_LOGS=foo.log $MAKE -e clean
+run_make TEST_LOGS=foo.log clean
 test ! -e foo.trs
 test -f bar.trs
 test ! -e sub/zardoz.trs
index bf86bc7350a40f7fae2ff9748b45f0c388a761dc..d833d96216a944d5e379bbb4ea207a02fee34e25 100644 (file)
@@ -95,14 +95,14 @@ grep '^PASS: baz\.test' stdout
 
 : Recreate with a "make check" with redefined TESTS.
 rm -f foo.trs bar.trs baz.trs
-TESTS=foo.test $MAKE -e check
+run_make TESTS=foo.test check
 test -f foo.trs
 test ! -e bar.trs
 test ! -e baz.trs
 
 : Recreate with a "make check" with redefined TEST_LOGS.
 rm -f foo.trs bar.trs baz.trs
-TEST_LOGS=bar.log $MAKE -e check
+run_make TEST_LOGS=bar.log check
 test ! -e foo.trs
 test -f bar.trs
 test ! -e baz.trs
@@ -152,7 +152,7 @@ test -f baz.trs
 rm -f foo.trs
 update_stamp
 touch bar.test
-RECHECK_LOGS= $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check >stdout || { cat stdout; exit 1; }
 cat stdout
 # Check that make has updated what it needed to, but no more.
 test -f foo.trs
index 6fad2908938fa7668f20b782d2ea04eb131633b8..f65096157bd82c43410b89b06ffa7ec95604bc92 100644 (file)
@@ -107,7 +107,7 @@ $sleep
 touch stamp
 $sleep
 touch bar.test
-RECHECK_LOGS= $MAKE -e check >stdout || { cat stdout; exit 1; }
+run_make RECHECK_LOGS= check >stdout || { cat stdout; exit 1; }
 cat stdout
 test -r foo.trs
 is_newest bar.trs bar.test
index d8e49360c4663d64925b8355537d97afd2cae529..2f2533fb7dc159d110680f9dda5c091b6a7f9787 100644 (file)
@@ -50,7 +50,7 @@ cat stdout
 grep '^See \./my_test_suite\.log$' stdout
 
 mkdir bar
-TEST_SUITE_LOG=bar/bar.log $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TEST_SUITE_LOG=bar/bar.log check >stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^See \./bar/bar\.log$' stdout
 
@@ -80,7 +80,7 @@ cat stdout
 grep '^See sub/test-suite\.log$' stdout
 cd ..
 
-TEST_SUITE_LOG=foo.log $MAKE -e check >stdout && { cat stdout; exit 1; }
+run_make TEST_SUITE_LOG=foo.log check >stdout && { cat stdout; exit 1; }
 cat stdout
 grep '^See sub/foo\.log$' stdout
 
index 74b04ebc1010d60a8e4e42c349f1639a2abad647..e31a2e1aceef8d1e51c0364f16e1ac6978886803 100644 (file)
@@ -118,7 +118,7 @@ test ! -e sub/main2.html
 test ! -e rec/main3.html
 
 # Test production of a single HTML file.
-MAKEINFOFLAGS=--no-split $MAKE -e html
+run_make MAKEINFOFLAGS=--no-split html
 test -f main.html
 test -f sub/main2.html
 test -f rec/main3.html
index 9d0bd8b8fda5f0c41c054601c0cb724cf399d8c0..e3eb0c9d38ba21c1a75a119dbeb831d46f615cfe 100644 (file)
@@ -118,7 +118,7 @@ test ! -e sub/main2.html
 test ! -e rec/main3.html
 
 # Test production of a single HTML file.
-MAKEINFOFLAGS=--no-split $MAKE -e html
+run_make MAKEINFOFLAGS=--no-split html
 test -f main.html
 test -f sub/main2.html
 test -f rec/main3.html
index 3eea823c629eab565f08fcf1b7815a5272cfe77c..03c0483fe64aaaefcb7ed1a07a8122e17b323015 100644 (file)
@@ -20,8 +20,6 @@
 required='cc yacc'
 . test-init.sh
 
-unset YFLAGS
-
 cat >> configure.ac <<'END'
 AC_PROG_CC
 AC_PROG_YACC
@@ -36,8 +34,9 @@ foo_SOURCES = foo.y
 # would be useful in general, so it's probably better to be
 # conservative).
 CLEANFILES = foo.output
-# Another automake wart: '-d' flag won't be given at automake time,
-# so automake won't be able to generate code to clean 'foo.h' :-(
+# As the '-d' flag won't be given at automake time, automake won't
+# be able to generate code to clean 'foo.h'.  We can't really blame
+# automake for that.
 MAINTAINERCLEANFILES = foo.h
 END
 
@@ -76,7 +75,7 @@ $MAKE maintainer-clean
 ls -l
 
 ./configure YFLAGS='-v'
-YFLAGS=-d $MAKE -e
+run_make YFLAGS=-d
 ls -l
 test -f foo.c
 test -f foo.h
index f8fe7a40764676c120b71ebc0b4ab536ab3f1b15..74855161f1bf312ba3e48bfd636419dcebc5876d 100644 (file)
@@ -28,10 +28,6 @@ echo 'extern int dummy;' >> y.tab.c
 END
 chmod a+x fake-yacc
 
-# Remove Yacc from the environment, so that it won't interfere
-# with 'make -e' below.
-unset YACC
-
 cat >> configure.ac <<'END'
 AC_SUBST([CC], [false])
 # Simulate presence of Yacc using our fake-yacc script.
@@ -59,7 +55,7 @@ grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && exit 1
 
 $AUTOCONF
 ./configure
-env YFLAGS=__user_flags__ $MAKE -e foo.c bar-bar.c
+run_make YFLAGS=__user_flags__ foo.c bar-bar.c
 
 cat foo.c
 cat bar-bar.c
index 12eb5d72601df3ff59cfda3aa23fe8cde6da7f01..1987cace93d1ce5ed6b0487bfffe41413acaba28 100644 (file)
@@ -28,10 +28,6 @@ echo 'extern int dummy;' >> y.tab.c
 END
 chmod a+x fake-yacc
 
-# Remove Yacc from the environment, so that it won't interfere
-# with 'make -e' below.
-unset YACC
-
 cat >> configure.ac <<'END'
 AC_SUBST([CXX], [false])
 # Simulate presence of Yacc using our fake-yacc script.
@@ -59,7 +55,7 @@ grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && exit 1
 
 $AUTOCONF
 ./configure
-env YFLAGS=__user_flags__ $MAKE -e foo.cc bar-bar.c++
+run_make YFLAGS=__user_flags__ foo.cc bar-bar.c++
 
 cat foo.cc
 cat bar-bar.c++