# 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.
$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
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
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 \
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,
## 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.
-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
## 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
+
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
.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
}
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
# -----------------------------------------------------------------------
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
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"
./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
$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
./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
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
./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.
./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
# 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
# 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 :-)'"
$MAKE
$MAKE distcheck
-infodir="$(pwd)/_info" $MAKE -e distcheck
+run_make infodir="$(pwd)/_info" distcheck
test -f _info/dir || exit 99 # Sanity check.
:
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
./configure
-EXEEXT=.foo $MAKE -e print > stdout
+run_make EXEEXT=.foo print > stdout
cat stdout
grep '1BEG: maude.foo mt.foo :END1' stdout
./configure revert=yes
-EXEEXT=.foo $MAKE -e print > stdout
+run_make EXEEXT=.foo print > stdout
cat stdout
grep '1BEG: maude.foo :END1' stdout
../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"
:
../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"
:
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"
:
doinst ()
{
- $MAKE install install-pdf install-ps install-dvi ${1+"$@"}
+ run_make install install-pdf install-ps install-dvi ${1+"$@"}
}
: > foo.sh
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
:
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; }
:
../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"
:
$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"
:
../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"
:
../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"
:
./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
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
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
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
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
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
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
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
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
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
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"
$AUTOCONF
./configure
-env JAVACFLAGS=__user_flags__ $MAKE -e
+run_make JAVACFLAGS=__user_flags__
ls -l
$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
$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++
$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
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
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
:
. 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__
./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
:
$AUTOMAKE
$AUTOCONF
./configure
-DISTCHECK_CONFIGURE_FLAGS=foo=bar $MAKE -e distcheck
+run_make DISTCHECK_CONFIGURE_FLAGS='foo=bar' distcheck
:
# 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
# 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
# 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
# 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
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
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
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
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
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
:
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 || :
{
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.
# 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 ..
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 ...
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
# 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
'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
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
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
./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
# 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
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.
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.
./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.
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
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
./configure
-OBJEXT=quux $MAKE -e test-fake
+run_make OBJEXT=quux test-fake
$MAKE test-real
:
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
%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
%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
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
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
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
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
# 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
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
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
# 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 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
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
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
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.
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 ()
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
$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
# 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
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
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
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
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
:
$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 \
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
# 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
$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
# 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
# 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
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
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
$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
: 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
: 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
: 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
: 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
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
: 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
# 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
: 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
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
./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
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
$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
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
# 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
# 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
: 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
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
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
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
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
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
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
required='cc yacc'
. test-init.sh
-unset YFLAGS
-
cat >> configure.ac <<'END'
AC_PROG_CC
AC_PROG_YACC
# 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
ls -l
./configure YFLAGS='-v'
-YFLAGS=-d $MAKE -e
+run_make YFLAGS=-d
ls -l
test -f foo.c
test -f foo.h
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.
$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
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.
$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++