summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/t/parallel-tests-html.sh8
-rw-r--r--maintainer/syntax-checks.mk32
-rw-r--r--t/ax/am-test-lib.sh173
-rw-r--r--t/ax/tap-summary-aux.sh6
-rw-r--r--t/ax/test-lib.sh30
-rw-r--r--t/ax/testsuite-summary-checks.sh10
-rw-r--r--t/check-concurrency-bug9245.sh9
-rw-r--r--t/check10.sh29
-rw-r--r--t/check11.sh4
-rw-r--r--t/check5.sh2
-rw-r--r--t/check7.sh2
-rw-r--r--t/color-tests.sh7
-rw-r--r--t/distcheck-configure-flags.sh3
-rw-r--r--t/distcheck-override-infodir.sh2
-rw-r--r--t/distdir.sh2
-rw-r--r--t/exeext.sh4
-rw-r--r--t/instdir-java.sh12
-rw-r--r--t/instdir-lisp.sh11
-rw-r--r--t/instdir-ltlib.sh26
-rw-r--r--t/instdir-no-empty.sh6
-rw-r--r--t/instdir-prog.sh24
-rw-r--r--t/instdir-python.sh11
-rw-r--r--t/instdir-texi.sh13
-rw-r--r--t/instdir.sh11
-rw-r--r--t/instdir2.sh11
-rw-r--r--t/insthook.sh2
-rw-r--r--t/instmany-mans.sh43
-rw-r--r--t/instmany-python.sh43
-rw-r--r--t/instmany.sh43
-rw-r--r--t/instspc.tap2
-rw-r--r--t/javaflags.sh2
-rw-r--r--t/lflags.sh2
-rw-r--r--t/lflags2.sh2
-rw-r--r--t/libtool9.sh11
-rw-r--r--t/link_cond.sh8
-rw-r--r--t/lisp-flags.sh6
-rw-r--r--t/man3.sh2
-rw-r--r--t/mmodely.sh3
-rw-r--r--t/parallel-tests-basics.sh12
-rw-r--r--t/parallel-tests-cmdline-override.sh2
-rw-r--r--t/parallel-tests-empty-testlogs.sh4
-rw-r--r--t/parallel-tests-exit-statuses.sh51
-rw-r--r--t/parallel-tests-extra-programs.sh7
-rw-r--r--t/parallel-tests-fork-bomb.sh2
-rw-r--r--t/parallel-tests-harderror.sh5
-rw-r--r--t/parallel-tests-log-compiler-1.sh2
-rw-r--r--t/parallel-tests-log-override-1.sh10
-rw-r--r--t/parallel-tests-log-override-2.sh4
-rw-r--r--t/parallel-tests-log-override-recheck.sh4
-rw-r--r--t/parallel-tests-no-color-in-log.sh2
-rw-r--r--t/parallel-tests-recheck-pr11791.sh6
-rw-r--r--t/remake-subdir-long-time.sh4
-rw-r--r--t/remake-timing-bug-pr8365.sh5
-rw-r--r--t/subst-no-trailing-empty-line.sh4
-rw-r--r--t/suffix-custom-subobj.sh2
-rw-r--r--t/suffix11.tap2
-rw-r--r--t/suffix6c.sh4
-rw-r--r--t/suffix8.tap2
-rw-r--r--t/tap-autonumber.sh2
-rw-r--r--t/tap-bailout-leading-space.sh2
-rw-r--r--t/tap-bailout-suppress-later-errors.sh2
-rw-r--r--t/tap-bailout.sh2
-rw-r--r--t/tap-basic.sh4
-rw-r--r--t/tap-color.sh8
-rw-r--r--t/tap-diagnostic.sh2
-rw-r--r--t/tap-doc2.sh4
-rw-r--r--t/tap-global-log.sh3
-rw-r--r--t/tap-global-result.sh4
-rw-r--r--t/tap-log.sh4
-rw-r--r--t/tap-merge-stdout-stderr.sh2
-rw-r--r--t/tap-msg0-bailout.sh2
-rw-r--r--t/tap-msg0-planskip.sh2
-rw-r--r--t/tap-out-of-order.sh2
-rw-r--r--t/tap-passthrough-exit.sh2
-rw-r--r--t/tap-passthrough.sh6
-rw-r--r--t/tap-plan-corner.sh16
-rw-r--r--t/tap-plan-leading-zero.sh4
-rw-r--r--t/tap-plan-malformed.sh2
-rw-r--r--t/tap-plan-middle.sh4
-rw-r--r--t/tap-plan-whitespace.sh2
-rw-r--r--t/tap-plan.sh4
-rw-r--r--t/tap-planskip-and-logging.sh2
-rw-r--r--t/tap-planskip-case-insensitive.sh2
-rw-r--r--t/tap-planskip-late.sh2
-rw-r--r--t/tap-planskip-unplanned-corner.sh2
-rw-r--r--t/tap-planskip-whitespace.sh2
-rw-r--r--t/tap-planskip.sh4
-rw-r--r--t/tap-recheck-logs.sh12
-rw-r--r--t/tap-test-number-0.sh2
-rw-r--r--t/tap-unplanned.sh2
-rw-r--r--t/tap-xfail-tests.sh8
-rw-r--r--t/test-driver-cond.sh8
-rw-r--r--t/test-driver-custom-multitest-recheck2.sh18
-rw-r--r--t/test-driver-custom-multitest.sh2
-rw-r--r--t/test-log.sh4
-rw-r--r--t/test-missing.sh6
-rw-r--r--t/test-trs-basic.sh14
-rw-r--r--t/test-trs-recover.sh6
-rw-r--r--t/test-trs-recover2.sh2
-rw-r--r--t/tests-environment-fd-redirect.sh3
-rw-r--r--t/testsuite-summary-reference-log.sh4
-rw-r--r--t/txinfo-many-output-formats-vpath.sh2
-rw-r--r--t/txinfo-many-output-formats.sh2
-rw-r--r--t/uninstall-fail.sh10
-rw-r--r--t/yacc-dist-nobuild.sh5
-rw-r--r--t/yflags-cmdline-override.sh9
-rw-r--r--t/yflags.sh6
-rw-r--r--t/yflags2.sh6
108 files changed, 576 insertions, 405 deletions
diff --git a/contrib/t/parallel-tests-html.sh b/contrib/t/parallel-tests-html.sh
index d4951b110..209dda880 100755
--- a/contrib/t/parallel-tests-html.sh
+++ b/contrib/t/parallel-tests-html.sh
@@ -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
diff --git a/maintainer/syntax-checks.mk b/maintainer/syntax-checks.mk
index 7e6391b40..e849d1ba6 100644
--- a/maintainer/syntax-checks.mk
+++ b/maintainer/syntax-checks.mk
@@ -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 \
@@ -361,6 +362,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,
@@ -369,11 +381,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.
@@ -386,16 +393,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
diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh
index f35ccd5de..5c918db40 100644
--- a/t/ax/am-test-lib.sh
+++ b/t/ax/am-test-lib.sh
@@ -121,6 +121,159 @@ 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] [-O] [-E] [-M] [--] [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.
+#
+# Other options:
+#
+# -O save the standard output from make on disk, in a regular file
+# named 'stdout'.
+#
+# -E save the standard error from make on disk, in a regular file
+# named 'stderr'.
+#
+# -M save both the standard output and standard error from make on
+# disk, in a regular file named 'output'. This option supersedes
+# both the '-O' and '-E' options.
+#
+# 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 ()
+{
+ am__make_redirect=
+ am__make_flags=
+ # 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;;
+ -O) am__make_redirect="$am__make_redirect >stdout";;
+ -E) am__make_redirect="$am__make_redirect 2>stderr";;
+ -M) am__make_redirect=">output 2>&1";;
+ --) shift; break;;
+ *) break;;
+ esac
+ shift
+ done
+
+ 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
+ set AM_MAKEFLAGS="$am__make_flags" ${1+"$@"}
+ unset am__make_flags
+ fi
+
+ eval "\$MAKE${am__make_redirect}"' ${1+"$@"}' || am_make_rc_got=$?
+
+ case $am__make_redirect in
+ *output*) cat output;;
+ *stderr*stdout*) cat stdout && cat stderr >&2;;
+ *stdout*stderr*) cat stdout && cat stderr >&2;;
+ *stdout*) cat stdout;;
+ *stderr*) cat stderr >&2;;
+ esac \
+ || fatal_ "displaying make output"
+
+ 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
+ unset am__make_redirect
+}
+
# AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
# -----------------------------------------------------------------
# Run automake with AUTOMAKE-ARGS, and fail if it doesn't exit with
@@ -311,7 +464,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
@@ -323,12 +476,12 @@ END
yes) return 0;;
no) return 1;;
"") ;;
- *) fatal_ "no_useless_builddir_remake: internal error";;
+ *) fatal_ "useless_vpath_rebuild: internal error";;
esac
}
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
# -----------------------------------------------------------------------
@@ -587,16 +740,17 @@ require_tool ()
|| skip_all_ "required program 'etags' not available"
;;
GNUmake)
- for make_ in "$MAKE" gmake gnumake :; do
- MAKE=$make_ am__using_gmake=''
- test "$MAKE" = : && break
+ for am_make in "$MAKE" gmake gnumake :; do
+ MAKE=$am_make
+ am__using_gmake= # Invalidate cache used by 'using_gmake()'.
+ test "$MAKE" = : && break
echo "$me: determine whether $MAKE is GNU make"
using_gmake && break
: For shells with busted 'set -e'.
done
test "$MAKE" = : && skip_all_ "this test requires GNU make"
export MAKE
- unset make_
+ unset am_make
;;
gcj)
GCJ=$GNU_GCJ GCJFLAGS=$GNU_GCJFLAGS; export GCJ GCJFLAGS
@@ -652,8 +806,7 @@ require_tool ()
java -version -help || skip_all_ "Sun Java interpreter not found"
;;
lib)
- AR=lib
- export AR
+ AR=lib; export AR
# Attempting to create an empty archive will actually not
# create the archive, but lib will output its version.
echo "$me: running $AR -out:defstest.lib"
@@ -677,7 +830,7 @@ require_tool ()
non-root)
# Skip this test case if the user is root.
# We try to append to a read-only file to detect this.
- priv_check_temp=priv-check.$$
+ priv_check_temp=am--priv-check.$$
touch $priv_check_temp && chmod a-w $priv_check_temp \
|| framework_failure_ "creating unwritable file $priv_check_temp"
# Not a useless use of subshell: lesser shells might bail
diff --git a/t/ax/tap-summary-aux.sh b/t/ax/tap-summary-aux.sh
index 1872caa47..227007930 100644
--- a/t/ax/tap-summary-aux.sh
+++ b/t/ax/tap-summary-aux.sh
@@ -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
diff --git a/t/ax/test-lib.sh b/t/ax/test-lib.sh
index ee83dcff3..aa015d68d 100644
--- a/t/ax/test-lib.sh
+++ b/t/ax/test-lib.sh
@@ -105,18 +105,24 @@ alias exit=_am_exit
# "unset VAR" returns a non-zero exit status in case the VAR variable
# is already unset. This doesn't interact well with our usage of
# "set -e" in the testsuite. This function and the alias below help
-# to work around the issue.
-_am_unset ()
-{
- for _am_v
- do
- # Extra escaping (here and below) to ensure we do not call our
- # 'unset' alias.
- eval ${_am_v}=dummy && \unset ${_am_v} || exit 1
- done
- \unset _am_v
-}
-alias unset=_am_unset
+# to work around the issue. But be sure to use them only if actually
+# needed. The repeated unset in the check below cater to the very
+# unlikely case where the '_am_v' variable is set in the environment.
+if unset _am_v && unset _am_v; then
+ : Nothing needs to be done.
+else
+ _am_unset ()
+ {
+ for _am_v
+ do
+ # Extra escaping (here and below) to ensure we do not call our
+ # 'unset' alias.
+ eval ${_am_v}=dummy && \unset ${_am_v} || return 1
+ done
+ \unset _am_v
+ }
+ alias unset=_am_unset
+fi
## ------------------------------------ ##
## General testsuite shell functions. ##
diff --git a/t/ax/testsuite-summary-checks.sh b/t/ax/testsuite-summary-checks.sh
index 63f3f9158..94de72d78 100644
--- a/t/ax/testsuite-summary-checks.sh
+++ b/t/ax/testsuite-summary-checks.sh
@@ -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"
diff --git a/t/check-concurrency-bug9245.sh b/t/check-concurrency-bug9245.sh
index eaf66d97d..abe01d3bb 100644
--- a/t/check-concurrency-bug9245.sh
+++ b/t/check-concurrency-bug9245.sh
@@ -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
diff --git a/t/check10.sh b/t/check10.sh
index d66ad2c7a..3bb180b20 100644
--- a/t/check10.sh
+++ b/t/check10.sh
@@ -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
diff --git a/t/check11.sh b/t/check11.sh
index 61b95be03..3526d84a7 100644
--- a/t/check11.sh
+++ b/t/check11.sh
@@ -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
diff --git a/t/check5.sh b/t/check5.sh
index 2b2d7434d..a70883919 100644
--- a/t/check5.sh
+++ b/t/check5.sh
@@ -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.
diff --git a/t/check7.sh b/t/check7.sh
index 5f19af0d0..5575f953f 100644
--- a/t/check7.sh
+++ b/t/check7.sh
@@ -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
diff --git a/t/color-tests.sh b/t/color-tests.sh
index ae6ef686e..9a0d4351f 100644
--- a/t/color-tests.sh
+++ b/t/color-tests.sh
@@ -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
diff --git a/t/distcheck-configure-flags.sh b/t/distcheck-configure-flags.sh
index 3c23117c7..dece1c443 100644
--- a/t/distcheck-configure-flags.sh
+++ b/t/distcheck-configure-flags.sh
@@ -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 :-)'"
diff --git a/t/distcheck-override-infodir.sh b/t/distcheck-override-infodir.sh
index cc2a5d6e8..6127f2bc1 100644
--- a/t/distcheck-override-infodir.sh
+++ b/t/distcheck-override-infodir.sh
@@ -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.
:
diff --git a/t/distdir.sh b/t/distdir.sh
index a050d3e2a..94de0d2af 100644
--- a/t/distdir.sh
+++ b/t/distdir.sh
@@ -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
diff --git a/t/exeext.sh b/t/exeext.sh
index 35b1a2109..604e9a5fe 100644
--- a/t/exeext.sh
+++ b/t/exeext.sh
@@ -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
diff --git a/t/instdir-java.sh b/t/instdir-java.sh
index 97eff573c..547ec5f7c 100644
--- a/t/instdir-java.sh
+++ b/t/instdir-java.sh
@@ -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"
:
diff --git a/t/instdir-lisp.sh b/t/instdir-lisp.sh
index 0c31b81f5..97605571c 100644
--- a/t/instdir-lisp.sh
+++ b/t/instdir-lisp.sh
@@ -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"
:
diff --git a/t/instdir-ltlib.sh b/t/instdir-ltlib.sh
index 273206cba..4b54cab43 100644
--- a/t/instdir-ltlib.sh
+++ b/t/instdir-ltlib.sh
@@ -66,31 +66,17 @@ cd build
../configure --prefix="$instdir" PYTHON="echo" \
am_cv_python_pythondir="$instdir/python" \
am_cv_python_pyexecdir="$instdir/pyexec"
-xMAKE ()
-{
- # Early line break here to please maintainer-check.
- $MAKE \
- bindir= libdir= pyexecdir= \
- AM_MAKEFLAGS='bindir= libdir= pyexecdir=' \
- "$@"
-}
-xMAKE
+nukedirs='bindir= libdir= pyexecdir='
-xMAKE install
+run_make $nukedirs install
test ! -e "$instdir"
-xMAKE install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
test ! -e "$instdir"
test ! -e "$destdir"
-xMAKE uninstall > 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
-xMAKE uninstall DESTDIR="$destdir" > stdout || { cat stdout; exit 1; }
-cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
-
-$MAKE
+grep 'rm -f' stdout && exit 1
+run_make $nukedirs uninstall DESTDIR="$destdir"
:
diff --git a/t/instdir-no-empty.sh b/t/instdir-no-empty.sh
index 66d76f2ed..03e18623d 100644
--- a/t/instdir-no-empty.sh
+++ b/t/instdir-no-empty.sh
@@ -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
:
diff --git a/t/instdir-prog.sh b/t/instdir-prog.sh
index f2b96b8ee..b5a8addca 100644
--- a/t/instdir-prog.sh
+++ b/t/instdir-prog.sh
@@ -66,29 +66,19 @@ cd build
am_cv_python_pythondir="$instdir/python" \
am_cv_python_pyexecdir="$instdir/pyexec"
-xMAKE ()
-{
- # Early line break here to please maintainer-check.
- $MAKE \
- bindir= libdir= pyexecdir= \
- AM_MAKEFLAGS='bindir= libdir= pyexecdir=' \
- "$@"
-}
+nukedirs='bindir= libdir= pyexecdir='
-xMAKE
-
-xMAKE install
+run_make $nukedirs install
test ! -e "$instdir"
-xMAKE install DESTDIR="$destdir"
+run_make $nukedirs install DESTDIR="$destdir"
test ! -e "$instdir"
test ! -e "$destdir"
-xMAKE uninstall > stdout || { cat stdout; exit 1; }
-cat stdout
-# Creative quoting below to please maintainer-check.
-grep 'rm'' ' stdout && exit 1
-xMAKE 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; }
:
diff --git a/t/instdir-python.sh b/t/instdir-python.sh
index 680f97ff5..e431a0635 100644
--- a/t/instdir-python.sh
+++ b/t/instdir-python.sh
@@ -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"
:
diff --git a/t/instdir-texi.sh b/t/instdir-texi.sh
index fa08e3e54..5cdaddbef 100644
--- a/t/instdir-texi.sh
+++ b/t/instdir-texi.sh
@@ -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"
:
diff --git a/t/instdir.sh b/t/instdir.sh
index 06e14ac7e..bd5915bc7 100644
--- a/t/instdir.sh
+++ b/t/instdir.sh
@@ -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"
:
diff --git a/t/instdir2.sh b/t/instdir2.sh
index 834078bd7..78a8acca0 100644
--- a/t/instdir2.sh
+++ b/t/instdir2.sh
@@ -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"
:
diff --git a/t/insthook.sh b/t/insthook.sh
index 92840df96..d2558e204 100644
--- a/t/insthook.sh
+++ b/t/insthook.sh
@@ -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
diff --git a/t/instmany-mans.sh b/t/instmany-mans.sh
index 2cb3ce9f8..eb0c9dbb9 100644
--- a/t/instmany-mans.sh
+++ b/t/instmany-mans.sh
@@ -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
diff --git a/t/instmany-python.sh b/t/instmany-python.sh
index ee8b94e03..dfcf14bf2 100644
--- a/t/instmany-python.sh
+++ b/t/instmany-python.sh
@@ -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
diff --git a/t/instmany.sh b/t/instmany.sh
index 62697c565..0a479cc30 100644
--- a/t/instmany.sh
+++ b/t/instmany.sh
@@ -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
diff --git a/t/instspc.tap b/t/instspc.tap
index 5ca2b922d..82663562a 100644
--- a/t/instspc.tap
+++ b/t/instspc.tap
@@ -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"
diff --git a/t/javaflags.sh b/t/javaflags.sh
index bb9ab26a4..ec405d656 100644
--- a/t/javaflags.sh
+++ b/t/javaflags.sh
@@ -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
diff --git a/t/lflags.sh b/t/lflags.sh
index 18268b188..ce6ccc8de 100644
--- a/t/lflags.sh
+++ b/t/lflags.sh
@@ -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
diff --git a/t/lflags2.sh b/t/lflags2.sh
index a959aeab2..d21afad4d 100644
--- a/t/lflags2.sh
+++ b/t/lflags2.sh
@@ -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++
diff --git a/t/libtool9.sh b/t/libtool9.sh
index bb6ac87d9..69bd72c08 100644
--- a/t/libtool9.sh
+++ b/t/libtool9.sh
@@ -84,9 +84,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
diff --git a/t/link_cond.sh b/t/link_cond.sh
index 43f06d812..98b523bc3 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -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
:
diff --git a/t/lisp-flags.sh b/t/lisp-flags.sh
index a31bcfdf0..ee156d777 100644
--- a/t/lisp-flags.sh
+++ b/t/lisp-flags.sh
@@ -18,10 +18,6 @@
. 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
:
diff --git a/t/man3.sh b/t/man3.sh
index 24a239289..31c283298 100644
--- 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
:
diff --git a/t/mmodely.sh b/t/mmodely.sh
index cb3152dd3..42f8ca4ae 100644
--- a/t/mmodely.sh
+++ b/t/mmodely.sh
@@ -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
diff --git a/t/parallel-tests-basics.sh b/t/parallel-tests-basics.sh
index d86e054d7..4d0fe9502 100644
--- a/t/parallel-tests-basics.sh
+++ b/t/parallel-tests-basics.sh
@@ -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
diff --git a/t/parallel-tests-cmdline-override.sh b/t/parallel-tests-cmdline-override.sh
index ab27784bc..ef78c2632 100644
--- a/t/parallel-tests-cmdline-override.sh
+++ b/t/parallel-tests-cmdline-override.sh
@@ -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
diff --git a/t/parallel-tests-empty-testlogs.sh b/t/parallel-tests-empty-testlogs.sh
index 995b831aa..95b3657a7 100644
--- a/t/parallel-tests-empty-testlogs.sh
+++ b/t/parallel-tests-empty-testlogs.sh
@@ -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
diff --git a/t/parallel-tests-exit-statuses.sh b/t/parallel-tests-exit-statuses.sh
index d77c3b44d..8612004d6 100644
--- a/t/parallel-tests-exit-statuses.sh
+++ b/t/parallel-tests-exit-statuses.sh
@@ -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
:
diff --git a/t/parallel-tests-extra-programs.sh b/t/parallel-tests-extra-programs.sh
index 73e2fda65..b8d7a99de 100644
--- a/t/parallel-tests-extra-programs.sh
+++ b/t/parallel-tests-extra-programs.sh
@@ -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 || :
diff --git a/t/parallel-tests-fork-bomb.sh b/t/parallel-tests-fork-bomb.sh
index 215294b7b..e63c0d760 100644
--- a/t/parallel-tests-fork-bomb.sh
+++ b/t/parallel-tests-fork-bomb.sh
@@ -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.
diff --git a/t/parallel-tests-harderror.sh b/t/parallel-tests-harderror.sh
index 3563cfe52..26832a655 100644
--- a/t/parallel-tests-harderror.sh
+++ b/t/parallel-tests-harderror.sh
@@ -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 ..
diff --git a/t/parallel-tests-log-compiler-1.sh b/t/parallel-tests-log-compiler-1.sh
index 6434ae926..fd1f1c6ae 100644
--- a/t/parallel-tests-log-compiler-1.sh
+++ b/t/parallel-tests-log-compiler-1.sh
@@ -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 ...
diff --git a/t/parallel-tests-log-override-1.sh b/t/parallel-tests-log-override-1.sh
index 46520b66e..49fba566d 100644
--- a/t/parallel-tests-log-override-1.sh
+++ b/t/parallel-tests-log-override-1.sh
@@ -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
diff --git a/t/parallel-tests-log-override-2.sh b/t/parallel-tests-log-override-2.sh
index 8accc7b26..54e2ed924 100644
--- a/t/parallel-tests-log-override-2.sh
+++ b/t/parallel-tests-log-override-2.sh
@@ -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
diff --git a/t/parallel-tests-log-override-recheck.sh b/t/parallel-tests-log-override-recheck.sh
index d1fec7f25..ff6f58262 100644
--- a/t/parallel-tests-log-override-recheck.sh
+++ b/t/parallel-tests-log-override-recheck.sh
@@ -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
diff --git a/t/parallel-tests-no-color-in-log.sh b/t/parallel-tests-no-color-in-log.sh
index b8a56815c..966501658 100644
--- a/t/parallel-tests-no-color-in-log.sh
+++ b/t/parallel-tests-no-color-in-log.sh
@@ -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
diff --git a/t/parallel-tests-recheck-pr11791.sh b/t/parallel-tests-recheck-pr11791.sh
index 7fad70688..94d576ce2 100644
--- a/t/parallel-tests-recheck-pr11791.sh
+++ b/t/parallel-tests-recheck-pr11791.sh
@@ -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 -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.
diff --git a/t/remake-subdir-long-time.sh b/t/remake-subdir-long-time.sh
index 1cbd02e2a..cf03335c6 100644
--- a/t/remake-subdir-long-time.sh
+++ b/t/remake-subdir-long-time.sh
@@ -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.
diff --git a/t/remake-timing-bug-pr8365.sh b/t/remake-timing-bug-pr8365.sh
index 662b1743e..5060fd6bf 100644
--- a/t/remake-timing-bug-pr8365.sh
+++ b/t/remake-timing-bug-pr8365.sh
@@ -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
diff --git a/t/subst-no-trailing-empty-line.sh b/t/subst-no-trailing-empty-line.sh
index 860b427d4..3fcb1b7ac 100644
--- a/t/subst-no-trailing-empty-line.sh
+++ b/t/subst-no-trailing-empty-line.sh
@@ -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
diff --git a/t/suffix-custom-subobj.sh b/t/suffix-custom-subobj.sh
index 04d4350e2..6c012297b 100644
--- a/t/suffix-custom-subobj.sh
+++ b/t/suffix-custom-subobj.sh
@@ -53,7 +53,7 @@ $AUTOMAKE -a
./configure
-OBJEXT=quux $MAKE -e test-fake
+run_make OBJEXT=quux test-fake
$MAKE test-real
:
diff --git a/t/suffix11.tap b/t/suffix11.tap
index 60d193be9..5ee21af4b 100644
--- a/t/suffix11.tap
+++ b/t/suffix11.tap
@@ -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
diff --git a/t/suffix6c.sh b/t/suffix6c.sh
index 00c6da30c..319b64942 100644
--- a/t/suffix6c.sh
+++ b/t/suffix6c.sh
@@ -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
diff --git a/t/suffix8.tap b/t/suffix8.tap
index 7da543f61..12df48bf4 100644
--- a/t/suffix8.tap
+++ b/t/suffix8.tap
@@ -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
diff --git a/t/tap-autonumber.sh b/t/tap-autonumber.sh
index dbefb866a..f1820ce86 100644
--- a/t/tap-autonumber.sh
+++ b/t/tap-autonumber.sh
@@ -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
diff --git a/t/tap-bailout-leading-space.sh b/t/tap-bailout-leading-space.sh
index fda4b36d5..c84c61242 100644
--- a/t/tap-bailout-leading-space.sh
+++ b/t/tap-bailout-leading-space.sh
@@ -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
diff --git a/t/tap-bailout-suppress-later-errors.sh b/t/tap-bailout-suppress-later-errors.sh
index 936f71fb4..7f602942c 100644
--- a/t/tap-bailout-suppress-later-errors.sh
+++ b/t/tap-bailout-suppress-later-errors.sh
@@ -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
diff --git a/t/tap-bailout.sh b/t/tap-bailout.sh
index 635b7767b..b6c0f56d1 100644
--- a/t/tap-bailout.sh
+++ b/t/tap-bailout.sh
@@ -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
diff --git a/t/tap-basic.sh b/t/tap-basic.sh
index 680d18d2c..5e4462b26 100644
--- a/t/tap-basic.sh
+++ b/t/tap-basic.sh
@@ -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
diff --git a/t/tap-color.sh b/t/tap-color.sh
index ca2ee1727..997cb7965 100644
--- a/t/tap-color.sh
+++ b/t/tap-color.sh
@@ -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
diff --git a/t/tap-diagnostic.sh b/t/tap-diagnostic.sh
index 7834f6126..59b1bda41 100644
--- a/t/tap-diagnostic.sh
+++ b/t/tap-diagnostic.sh
@@ -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
diff --git a/t/tap-doc2.sh b/t/tap-doc2.sh
index 0d4bf14dd..55c734bd8 100644
--- a/t/tap-doc2.sh
+++ b/t/tap-doc2.sh
@@ -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
diff --git a/t/tap-global-log.sh b/t/tap-global-log.sh
index fc4a8fb75..b303b4ad5 100644
--- a/t/tap-global-log.sh
+++ b/t/tap-global-log.sh
@@ -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
diff --git a/t/tap-global-result.sh b/t/tap-global-result.sh
index f3718d300..a4a1fd161 100644
--- a/t/tap-global-result.sh
+++ b/t/tap-global-result.sh
@@ -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 ()
diff --git a/t/tap-log.sh b/t/tap-log.sh
index ef5429703..d7eab8a58 100644
--- a/t/tap-log.sh
+++ b/t/tap-log.sh
@@ -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
diff --git a/t/tap-merge-stdout-stderr.sh b/t/tap-merge-stdout-stderr.sh
index ad954121d..ef99d8204 100644
--- a/t/tap-merge-stdout-stderr.sh
+++ b/t/tap-merge-stdout-stderr.sh
@@ -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
diff --git a/t/tap-msg0-bailout.sh b/t/tap-msg0-bailout.sh
index c30242522..9e2bdcedf 100644
--- a/t/tap-msg0-bailout.sh
+++ b/t/tap-msg0-bailout.sh
@@ -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
diff --git a/t/tap-msg0-planskip.sh b/t/tap-msg0-planskip.sh
index 131d4389a..3c6252d77 100644
--- a/t/tap-msg0-planskip.sh
+++ b/t/tap-msg0-planskip.sh
@@ -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
diff --git a/t/tap-out-of-order.sh b/t/tap-out-of-order.sh
index 6b9806016..bac7acdb5 100644
--- a/t/tap-out-of-order.sh
+++ b/t/tap-out-of-order.sh
@@ -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
diff --git a/t/tap-passthrough-exit.sh b/t/tap-passthrough-exit.sh
index fbe7e9ee2..cf9ea4614 100644
--- a/t/tap-passthrough-exit.sh
+++ b/t/tap-passthrough-exit.sh
@@ -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
:
diff --git a/t/tap-passthrough.sh b/t/tap-passthrough.sh
index e7c9fca56..8132f5380 100644
--- a/t/tap-passthrough.sh
+++ b/t/tap-passthrough.sh
@@ -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
diff --git a/t/tap-plan-corner.sh b/t/tap-plan-corner.sh
index b3b81b816..27f41fdbc 100644
--- a/t/tap-plan-corner.sh
+++ b/t/tap-plan-corner.sh
@@ -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
diff --git a/t/tap-plan-leading-zero.sh b/t/tap-plan-leading-zero.sh
index 3dff53e3e..00caeb459 100644
--- a/t/tap-plan-leading-zero.sh
+++ b/t/tap-plan-leading-zero.sh
@@ -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
diff --git a/t/tap-plan-malformed.sh b/t/tap-plan-malformed.sh
index 9d1f19e6c..e2dd7d02c 100644
--- a/t/tap-plan-malformed.sh
+++ b/t/tap-plan-malformed.sh
@@ -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
diff --git a/t/tap-plan-middle.sh b/t/tap-plan-middle.sh
index 303ece5eb..bfc473b3f 100644
--- a/t/tap-plan-middle.sh
+++ b/t/tap-plan-middle.sh
@@ -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
diff --git a/t/tap-plan-whitespace.sh b/t/tap-plan-whitespace.sh
index b0363c953..659a7e77a 100644
--- a/t/tap-plan-whitespace.sh
+++ b/t/tap-plan-whitespace.sh
@@ -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
diff --git a/t/tap-plan.sh b/t/tap-plan.sh
index 6a5332e17..50ae42605 100644
--- a/t/tap-plan.sh
+++ b/t/tap-plan.sh
@@ -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
diff --git a/t/tap-planskip-and-logging.sh b/t/tap-planskip-and-logging.sh
index 3c4bcb502..b3089e41a 100644
--- a/t/tap-planskip-and-logging.sh
+++ b/t/tap-planskip-and-logging.sh
@@ -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
diff --git a/t/tap-planskip-case-insensitive.sh b/t/tap-planskip-case-insensitive.sh
index 8dc175711..54a644e52 100644
--- a/t/tap-planskip-case-insensitive.sh
+++ b/t/tap-planskip-case-insensitive.sh
@@ -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
diff --git a/t/tap-planskip-late.sh b/t/tap-planskip-late.sh
index 69cb9e660..ab3f336f5 100644
--- a/t/tap-planskip-late.sh
+++ b/t/tap-planskip-late.sh
@@ -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
diff --git a/t/tap-planskip-unplanned-corner.sh b/t/tap-planskip-unplanned-corner.sh
index 1f7e7fedc..217646995 100644
--- a/t/tap-planskip-unplanned-corner.sh
+++ b/t/tap-planskip-unplanned-corner.sh
@@ -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
diff --git a/t/tap-planskip-whitespace.sh b/t/tap-planskip-whitespace.sh
index be2437bff..9513ca2ec 100644
--- a/t/tap-planskip-whitespace.sh
+++ b/t/tap-planskip-whitespace.sh
@@ -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
diff --git a/t/tap-planskip.sh b/t/tap-planskip.sh
index bc9c0fd31..d0ab69272 100644
--- a/t/tap-planskip.sh
+++ b/t/tap-planskip.sh
@@ -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
diff --git a/t/tap-recheck-logs.sh b/t/tap-recheck-logs.sh
index 166de6e92..a4d52aae6 100644
--- a/t/tap-recheck-logs.sh
+++ b/t/tap-recheck-logs.sh
@@ -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
diff --git a/t/tap-test-number-0.sh b/t/tap-test-number-0.sh
index 03dc30724..a42ff548b 100644
--- a/t/tap-test-number-0.sh
+++ b/t/tap-test-number-0.sh
@@ -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
diff --git a/t/tap-unplanned.sh b/t/tap-unplanned.sh
index 6362335d4..11b68a32e 100644
--- a/t/tap-unplanned.sh
+++ b/t/tap-unplanned.sh
@@ -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
diff --git a/t/tap-xfail-tests.sh b/t/tap-xfail-tests.sh
index 79bde3082..b8b785e2a 100644
--- a/t/tap-xfail-tests.sh
+++ b/t/tap-xfail-tests.sh
@@ -36,9 +36,7 @@ not ok 6 # SKIP
Bail out!
END
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
count_test_results total=7 pass=0 fail=0 xpass=2 xfail=3 skip=1 error=1
grep '^XPASS: all\.test 1$' stdout
@@ -59,9 +57,7 @@ ok 2 # SKIP
not ok 3 # TODO
END
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-
+run_make -O check
count_test_results total=3 pass=0 fail=0 xpass=0 xfail=2 skip=1 error=0
:
diff --git a/t/test-driver-cond.sh b/t/test-driver-cond.sh
index cf408d02e..cf204c4f4 100644
--- a/t/test-driver-cond.sh
+++ b/t/test-driver-cond.sh
@@ -102,17 +102,15 @@ do_count ()
$EGREP 'XFAIL: baz\.sh 3( |$)' stdout
}
-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 || exit 1
do_count
-$MAKE distcheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O distcheck
do_count
:
diff --git a/t/test-driver-custom-multitest-recheck2.sh b/t/test-driver-custom-multitest-recheck2.sh
index c6c0d893a..0c435de2b 100644
--- a/t/test-driver-custom-multitest-recheck2.sh
+++ b/t/test-driver-custom-multitest-recheck2.sh
@@ -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
diff --git a/t/test-driver-custom-multitest.sh b/t/test-driver-custom-multitest.sh
index 5727af2e5..a21174a12 100644
--- a/t/test-driver-custom-multitest.sh
+++ b/t/test-driver-custom-multitest.sh
@@ -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
diff --git a/t/test-log.sh b/t/test-log.sh
index 54b7e81c9..f0da927a0 100644
--- a/t/test-log.sh
+++ b/t/test-log.sh
@@ -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
diff --git a/t/test-missing.sh b/t/test-missing.sh
index 0e46cf593..b3d42d929 100644
--- a/t/test-missing.sh
+++ b/t/test-missing.sh
@@ -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
diff --git a/t/test-trs-basic.sh b/t/test-trs-basic.sh
index 525d5bf18..a7f77d52f 100644
--- a/t/test-trs-basic.sh
+++ b/t/test-trs-basic.sh
@@ -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
diff --git a/t/test-trs-recover.sh b/t/test-trs-recover.sh
index bf86bc735..d833d9621 100644
--- a/t/test-trs-recover.sh
+++ b/t/test-trs-recover.sh
@@ -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
diff --git a/t/test-trs-recover2.sh b/t/test-trs-recover2.sh
index 6fad29089..f65096157 100644
--- a/t/test-trs-recover2.sh
+++ b/t/test-trs-recover2.sh
@@ -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
diff --git a/t/tests-environment-fd-redirect.sh b/t/tests-environment-fd-redirect.sh
index 243174acb..c08d5c666 100644
--- a/t/tests-environment-fd-redirect.sh
+++ b/t/tests-environment-fd-redirect.sh
@@ -79,8 +79,7 @@ for sh in "$SHELL" "$bin_ksh"; do
END
$AUTOMAKE -a
CONFIG_SHELL="$sh" $sh ./configure CONFIG_SHELL="$sh"
- VERBOSE=y $MAKE check >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O VERBOSE=y check
grep '[ /]foo\.test: foofoofoo$' stdout
grep '[ /]foo\.test: barbarbar$' stdout
grep '[ /]bar\.test: 8888$' stdout
diff --git a/t/testsuite-summary-reference-log.sh b/t/testsuite-summary-reference-log.sh
index d8e49360c..2f2533fb7 100644
--- a/t/testsuite-summary-reference-log.sh
+++ b/t/testsuite-summary-reference-log.sh
@@ -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
diff --git a/t/txinfo-many-output-formats-vpath.sh b/t/txinfo-many-output-formats-vpath.sh
index 74b04ebc1..e31a2e1ac 100644
--- a/t/txinfo-many-output-formats-vpath.sh
+++ b/t/txinfo-many-output-formats-vpath.sh
@@ -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
diff --git a/t/txinfo-many-output-formats.sh b/t/txinfo-many-output-formats.sh
index 9d0bd8b8f..e3eb0c9d3 100644
--- a/t/txinfo-many-output-formats.sh
+++ b/t/txinfo-many-output-formats.sh
@@ -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
diff --git a/t/uninstall-fail.sh b/t/uninstall-fail.sh
index f002e08a6..1c7f9da05 100644
--- a/t/uninstall-fail.sh
+++ b/t/uninstall-fail.sh
@@ -68,8 +68,7 @@ mkdir $inst $inst/share
: > $inst/share/foobar.txt
chmod a-w $inst/share
-$MAKE uninstall >output 2>&1 && { cat output; exit 1; }
-cat output
+run_make -M -e FAIL uninstall
if test $rm_f_is_silent_on_error = yes; then
: "rm -f" is silent on errors, skip the grepping of make output
else
@@ -79,9 +78,8 @@ fi
chmod a-rwx $inst/share
(cd $inst/share) && skip_ "cannot make directories fully unreadable"
-$MAKE uninstall >output 2>&1 && { cat output; exit 1; }
-cat output
-#
+run_make -M -e FAIL uninstall
+
# Some shells, like Solaris 10 /bin/ksh and /usr/xpg4/bin/sh, do not
# report the name of the 'cd' builtin upon a chdir error:
#
@@ -97,7 +95,7 @@ cat output
# > \
# > cd unreadable'
# /bin/ksh[3]: unreadable: permission denied
-#
+
$EGREP "(cd|sh)(\[[0-9]*[0-9]\])?: .*$inst/share" output
:
diff --git a/t/yacc-dist-nobuild.sh b/t/yacc-dist-nobuild.sh
index f0e0ea662..54164b832 100644
--- a/t/yacc-dist-nobuild.sh
+++ b/t/yacc-dist-nobuild.sh
@@ -83,8 +83,7 @@ chmod a-w $distdir
mkdir build2
cd build2
../$distdir/configure
-$MAKE >out 2>&1 && { cat out; exit 1; }
-cat out
-$FGREP parse.c out
+run_make -e FAIL -M
+$FGREP parse.c output
:
diff --git a/t/yflags-cmdline-override.sh b/t/yflags-cmdline-override.sh
index 3eea823c6..03c0483fe 100644
--- a/t/yflags-cmdline-override.sh
+++ b/t/yflags-cmdline-override.sh
@@ -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
diff --git a/t/yflags.sh b/t/yflags.sh
index f8fe7a407..74855161f 100644
--- a/t/yflags.sh
+++ b/t/yflags.sh
@@ -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
diff --git a/t/yflags2.sh b/t/yflags2.sh
index 12eb5d726..1987cace9 100644
--- a/t/yflags2.sh
+++ b/t/yflags2.sh
@@ -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++