test_no_color ()
{
- # With make implementations that, like Solaris make, in case of errors
- # print the whole failing recipe on standard output, we should content
- # ourselves with a laxer check, to avoid false positives.
- # Keep this in sync with lib/am/check.am:$(am__color_tests).
- if $FGREP '= Xalways || test -t 1 ' stdout; then
- # Extra verbose make, resort to laxer checks.
- # Note that we also want to check that the testsuite summary is
- # not unduly colorized.
- (
- set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
- cat stdout | grep "TOTAL.*:"
- cat stdout | grep "PASS.*:"
- cat stdout | grep "FAIL.*:"
- cat stdout | grep "SKIP.*:"
- cat stdout | grep "XFAIL.*:"
- cat stdout | grep "XPASS.*:"
- cat stdout | grep "ERROR.*:"
- cat stdout | grep 'test.*expected'
- cat stdout | grep 'test.*not run'
- cat stdout | grep '===='
- cat stdout | grep '[Ss]ee .*test-suite\.log'
- cat stdout | grep '[Tt]estsuite summary'
- ) | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- else
- cat stdout | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- fi
+ cat stdout | grep "$esc" && Exit 1
+ :
}
for vpath in false :; do
(set +e; expect -c 'exit ''77'; test $? -eq 77) \
|| skip_ "requires a working expect program"
-# Also, if the $MAKE program fails to consider the standard output as a
-# tty (this happens with e.g., BSD make and Solaris dmake when they're
-# run in parallel mode; see the autoconf manual), there is little point
-# in proceeding.
-cat > Makefile <<'END'
-all:
-## Creative quoting in the 'echo' below to avoid risk of spurious output
-## matches by 'expect', below.
- @test -t 1 && echo "stdout" "is" "a" "tty"
-END
-
-cat > expect-check <<'END'
-eval spawn $env(MAKE)
-expect {
- "stdout is a tty" { exit 0 }
- default { exit 1 }
-}
-exit 1
-END
-MAKE=$MAKE expect -f expect-check \
- || skip_ "make spawned by expect should have a tty stdout"
-rm -f expect-check Makefile
-
# Do the tests.
cat >>configure.ac <<END
test_no_color ()
{
- # With make implementations that, like Solaris make, in case of errors
- # print the whole failing recipe on standard output, we should content
- # ourselves with a laxer check, to avoid false positives.
- # Keep this in sync with lib/am/check.am:$(am__color_tests).
- if $FGREP '= Xalways || test -t 1 ' stdout; then
- # Extra verbose make, resort to laxer checks.
- # Note that we also want to check that the testsuite summary is
- # not unduly colorized.
- (
- set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
- cat stdout | grep "TOTAL.*:"
- cat stdout | grep "PASS.*:"
- cat stdout | grep "FAIL.*:"
- cat stdout | grep "SKIP.*:"
- cat stdout | grep "XFAIL.*:"
- cat stdout | grep "XPASS.*:"
- cat stdout | grep "ERROR.*:"
- cat stdout | grep 'test.*expected'
- cat stdout | grep 'test.*not run'
- cat stdout | grep '===='
- cat stdout | grep '[Ss]ee .*test-suite\.log'
- cat stdout | grep '[Tt]estsuite summary'
- ) | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- else
- cat stdout | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- fi
+ cat stdout | grep "$esc" && Exit 1
+ :
}
cat >expect-make <<'END'
&& rm -rf setup \
|| fatal_ "creating common aclocal.m4 file"
-# Some make implementations (e.g., HP-UX) don't grok '-j', some require
-# no space between '-j' and the number of jobs (e.g., older GNU make
-# versions), and some *do* require a space between '-j' and the number
-# of jobs (e.g., Solaris dmake). We need a runtime test to see what
-# works.
-for MAKE_j4 in "$MAKE -j4" "$MAKE -j 4" false; do
- echo all: | $MAKE_j4 -f - && break
- : For shells with buggy 'set -e'.
-done
-
# Set variables '$compressor' and '$suffix'.
setup_vars_for_compression_format ()
{
skip_reason=
have_compressor compress || skip_reason="'compress' not available"
have_compressor bzip2 || skip_reason="'bzip2' not available"
-if test "$MAKE_j4" = false; then
- test -z "$skip_reason" || skip_reason="$skip_reason and "
- skip_reason="${skip_reason}make concurrency unavailable"
-fi
if test -n "$skip_reason"; then
skip_row_ 6 -r "$skip_reason" "$desc"
else
command_ok_ "$desc [autoconf]" $AUTOCONF
command_ok_ "$desc [configure]" ./configure
- command_ok_ "$desc [make -j4 dist-all]" $MAKE_j4 dist
+ command_ok_ "$desc [make -j4 dist-all]" $MAKE -j4 dist
ls -l # For debugging.
command_ok_ "$desc [check .tar.gz tarball]" check_tarball gzip
command_ok_ "$desc [check .tar.bz2 tarball]" check_tarball bzip2
"$desc ['make dist-all', stubbed]" \
$MAKE dist-all
-subdesc="$desc ['make dist -j4', stubbed]"
-if test "$MAKE_j4" = false; then
- skip_ -r "make concurrency unavailable" "$subdesc"
-else
- command_ok_ "$subdesc" $MAKE_j4 dist
-fi
-unset subdesc
+command_ok_ "$desc ['make dist -j4', stubbed]" $MAKE -j4 dist
PATH=$oPATH; export PATH
check_no_spurious_error ()
{
$EGREP -i 'mkdir:|:.*(permission|denied)' output && Exit 1
- # On failure, some make implementations (such as Solaris make) print the
- # whole failed recipe on stdout. The first grep works around this.
- grep -v 'rm -rf ' output | grep -i 'autom4te.*\.cache' && Exit 1
- : To placate 'set -e'.
+ grep -i 'autom4te.*\.cache' output && Exit 1
+ : # To placate 'set -e'.
}
./configure
check_no_spurious_error ()
{
$EGREP -i 'mkdir:|:.*(permission|denied)' output && Exit 1
- # On failure, some make implementations (such as Solaris make) print the
- # whole failed recipe on stdout. The first grep works around this.
- grep -v 'rm -rf ' output | grep -i 'autom4te.*\.cache' && Exit 1
- : To placate 'set -e'.
+ grep -i 'autom4te.*\.cache' output && Exit 1
+ : # To placate 'set -e'.
}
# We start to use a new "third-party" macro in a new version
bar_LFLAGS = -v
foo_SOURCES = zardoz.l
bar_SOURCES = dir/quux.l
-## Avoid spurious failures with Solaris make.
-zardoz.@OBJEXT@: zardoz.c
-bar-quux.@OBJEXT@: bar-quux.c
END
cat > sub/Makefile.am << 'END'
foo_LFLAGS = -v
foo_SOURCES = zardoz.l
bar_SOURCES = dir/quux.l
-## Avoid spurious failures with Solaris make.
-foo-zardoz.@OBJEXT@: foo-zardoz.c
-dir/quux.@OBJEXT@: dir/quux.c
END
cat > zardoz.l << 'END'
libquux1.c:
echo 'int quux1(void) { return 0; }' > $@
-CLEANFILES = libquux1.c # For FreeBSD make.
END
cat > foo.c <<'END'
libbar.c:
echo 'int bar(void) { return 0; }' > $@
-CLEANFILES = libbar.c # For FreeBSD make.
installcheck-local:
ls -l $(prefix)/lib
libbar.c:
echo 'int bar(void) { return 0; }' > $@
-CLEANFILES = libbar.c # For FreeBSD make.
installcheck-local:
ls -l $(prefix)/lib
bar.c baz.c:
echo 'int $@ (void) { return 0; }' | sed 's/\.c //' > $@
CLEANFILES = baz.c
-CLEANFILES += bar.c # For FreeBSD make.
.PHONY: test test2
check-local: test1 test2
foo2.test barz:
(echo '#!/bin/sh' && echo 'exit 0') > $@ && chmod a+x $@
-CLEANFILES = foo2.test barz # For FreeBSD make.
# Also try an empty match suffix, to ensure that the ':=' in there is
# not confused by the parser with an unportable assignment operator.
cat stdout
grep 'DVIPS foo.ps' stdout || Exit 1
grep 'MAKEINFO foo.html' stdout || Exit 1
-# NetBSD make will print './foo.info' instead of 'foo.info'.
-grep 'MAKEINFO.*foo.info' stdout || Exit 1
+grep 'MAKEINFO foo.info' stdout || Exit 1
grep 'TEXI2DVI foo.dvi' stdout || Exit 1
grep 'TEXI2PDF foo.pdf' stdout || Exit 1
cat stdout
grep 'DVIPS foo.ps' stdout && Exit 1
grep 'MAKEINFO foo.html' stdout && Exit 1
-grep 'MAKEINFO.*foo.info' stdout && Exit 1
+grep 'MAKEINFO foo.info' stdout && Exit 1
grep 'TEXI2DVI foo.dvi' stdout && Exit 1
grep 'TEXI2PDF foo.pdf' stdout && Exit 1
test_no_color ()
{
- # With make implementations that, like Solaris make, in case of errors
- # print the whole failing recipe on standard output, we should content
- # ourselves with a laxer check, to avoid false positives.
- # Keep this in sync with lib/am/check.am:$(am__color_tests).
- if $FGREP '= Xalways || test -t 1 ' stdout; then
- # Extra verbose make, resort to laxer checks.
- # But we also want to check that the testsuite summary is not unduly
- # colorized.
- (
- set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
- cat stdout | grep "TOTAL.*:"
- cat stdout | grep "PASS.*:"
- cat stdout | grep "FAIL.*:"
- cat stdout | grep "SKIP.*:"
- cat stdout | grep "XFAIL.*:"
- cat stdout | grep "XPASS.*:"
- cat stdout | grep "ERROR.*:"
- cat stdout | grep "^#"
- cat stdout | grep 'test.*expected'
- cat stdout | grep 'test.*not run'
- cat stdout | grep '===='
- cat stdout | grep '[Ss]ee .*test-suite\.log'
- cat stdout | grep '[Tt]estsuite summary'
- ) | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- else
- cat stdout | grep "$esc" && Exit 1
- : For shells with broken 'set -e'
- fi
+ cat stdout | grep "$esc" && Exit 1
+ :
}
# It should be possible to override AM_COLOR_TESTS also from the
XFAIL: mu.tap 2 # TODO frobnication not yet implemented
END
-sed -n '/^PASS: foo\.sh/,/^XFAIL: mu\.tap/p' stdout > t
-cat t
-# Strip extra "informative" lines that could be printed by Solaris
-# Distributed Make.
-LC_ALL=C $EGREP -v ' --> ([0-9][0-9]* job|[Jj]ob output)' t > got
+sed -n '/^PASS: foo\.sh/,/^XFAIL: mu\.tap/p' stdout > got
cat exp
cat got
chmod a+x *.test
-# Strip extra "informative" lines that could be printed by Solaris
-# Distributed Make.
mkdir build-aux
cp "$am_scriptdir"/tap-driver.sh build-aux \
|| framework_failure_ "fetching the perl TAP driver"
run_make=$MAKE
;;
*)
- # Some make implementations (e.g., HP-UX) don't grok '-j',
- # some require no space between '-j' and the number of jobs
- # (e.g., older GNU make versions), and some *do* require a
- # space between '-j' and the number of jobs (e.g., Solaris
- # dmake). We need a runtime test to see what works.
- echo 'all:' > Makefile
- for run_make in "$MAKE -j3" "$MAKE -j 3" "$MAKE"; do
- $run_make && break
- done
- rm -f Makefile
+ run_make="$MAKE -j3"
;;
esac
else
esac
}
-command_ok_ '"make check" fails' eval '
- (
- st=0; $MAKE check >stdout || st=$?
- cat stdout
- # Extra "echo" and silencing of xtraces required to avoid possible
- # garbled output with NetBSD make, which would miss some final
- # newlines in the expected places and thus mess up our TAP output.
- set +x; echo
- test $st -gt 0
- )
-'
+command_ok_ '"make check" fails' eval 'not $MAKE check >stdout'
cat stdout # For debugging.
command_ok_ "count of test results" count_test_results \
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure depcomp does not needlessly update headers and objects
-# for yacc rules. This test still fails with FreeBSD make (but passes
-# with NetBSD make).
+# for yacc rules.
required=yacc
. ./defs || Exit 1
bar_YFLAGS =
foo_SOURCES = zardoz.y
bar_SOURCES = dir/quux.y
-## Avoid spurious failures with Solaris make.
-zardoz.@OBJEXT@: zardoz.c
-bar-quux.@OBJEXT@: bar-quux.c
END
cat > sub/Makefile.am << 'END'
foo_YFLAGS = -d
foo_SOURCES = zardoz.y
bar_SOURCES = dir/quux.y
-## Avoid spurious failures with Solaris make.
-foo-zardoz.@OBJEXT@: foo-zardoz.c
-dir/quux.@OBJEXT@: dir/quux.c
END
cat > zardoz.y << 'END'
# not override it.
run_make=$MAKE;;
*)
- # Some make implementations (e.g., HP-UX) don't grok '-j',
- # some require no space between '-j' and the number of jobs
- # (e.g., older GNU make versions), and some *do* require a
- # space between '-j' and the number of jobs (e.g., Solaris
- # dmake). We need a runtime test to see what works.
- echo 'all:' > Makefile
- for run_make in "$MAKE -j3" "$MAKE -j 3" "$MAKE"; do
- $run_make && break
- done
- rm -f Makefile
+ run_make="$MAKE -j3";;
esac
else
echo "$me: invalid value of \$try '$try'" >&2