m4 macro are deprecated, eliciting a warning in the 'obsolete'
category. They will be removed in the next major version (1.13).
+Bugs fixed in 1.12.1:
+
+* Long-standing bugs:
+
+ - When the 'color-tests' option is in use, forcing of colored testsuite
+ output through "AM_COLOR_TESTS=always" works even if the terminal is
+ a non-ANSI one, i.e., if the TERM environment variable has a value of
+ "dumb".
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.12:
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
if %?COLOR%
-# If stdout is a non-dumb tty, use colors. If test -t is not supported,
-# then this fails; a conservative approach. Of course do not redirect
-# stdout here, just stderr.
-am__tty_colors = \
-$(am__tty_colors_dummy); \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
- am__color_tests=yes; \
- red='\e[0;31m'; \
- grn='\e[0;32m'; \
- lgn='\e[1;32m'; \
- blu='\e[1;34m'; \
- mgn='\e[0;35m'; \
- brg='\e[1m'; \
- std='\e[m'; \
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+## If stdout is a non-dumb tty, use colors. If test -t is not supported,
+## then this check fails; a conservative approach. Of course do not
+## redirect stdout here, just stderr.
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red='\e[0;31m'; \
+ grn='\e[0;32m'; \
+ lgn='\e[1;32m'; \
+ blu='\e[1;34m'; \
+ mgn='\e[0;35m'; \
+ brg='\e[1m'; \
+ std='\e[m'; \
+ fi; \
}
else !%?COLOR%
am__tty_colors = $(am__tty_colors_dummy)
cat all.test
st=0
if test $use_colors = yes; then
- make_cmd="env TERM=ansi AM_COLOR_TESTS=always $MAKE -e"
+ # 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"
else
make_cmd=$MAKE
fi
case $use_colors in
yes)
AM_COLOR_TESTS=always; export AM_COLOR_TESTS
- TERM=ansi; export TERM
+ # Forced colorization should take place also with non-ANSI
+ # terminals; hence this setting.
+ TERM=dumb; export TERM
am_opts='parallel-tests color-tests'
;;
no)
# 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
+ if $FGREP '= Xalways; then' stdout; then
# Extra verbose make, resort to laxer checks.
# Note that we also want to check that the testsuite summary is
# not unduly colorized.
$srcdir/configure
- AM_COLOR_TESTS=always $MAKE -e check >stdout && { cat stdout; Exit 1; }
+ # 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; }
cat stdout
test_color
- $MAKE -e check >stdout && { cat stdout; Exit 1; }
+ TERM=ansi $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
test_no_color
. ./defs || Exit 1
-TERM=ansi
-export TERM
-
esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
# 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
+ if $FGREP '= Xalways; then' stdout; then
# Extra verbose make, resort to laxer checks.
# Note that we also want to check that the testsuite summary is
# not unduly colorized.
$srcdir/configure
- MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+ TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
|| { cat stdout; Exit 1; }
cat stdout
test_color
+ TERM=dumb MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+ || { cat stdout; Exit 1; }
+ cat stdout
+ test_no_color
+
AM_COLOR_TESTS=no MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
|| { cat stdout; Exit 1; }
cat stdout
esc='\e['
+TERM=ansi; export TERM
+
# Check that grep can parse nonprinting characters.
# BSD 'grep' works from a pipe, but not a seekable file.
# GNU or BSD 'grep -a' works on files, but is not portable.
cat > foobar << 'END'
#!/bin/sh
echo "TERM='$TERM'"
-echo "expected_term='$expected_term'"
-test x"$TERM" = x"$expected_term"
+test x"$TERM" = x"dumb"
END
chmod a+x foobar
mkcheck ()
{
- if env AM_COLOR_TESTS=always $* $MAKE check > stdout; then
+ if $MAKE "$@" check > stdout; then
rc=0
else
rc=1
$AUTOMAKE -a
./configure
-TERM=ansi; export TERM
-expected_term=dumb; export expected_term
mkcheck TESTS_ENVIRONMENT='TERM=dumb'
cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
-TERM=dumb; export TERM
-expected_term=ansi; export expected_term
-mkcheck TESTS_ENVIRONMENT='TERM=ansi'
-cat stdout | $FGREP "$esc" && Exit 1
-
-TERM=ansi; export TERM
-expected_term=dumb; export expected_term
mkcheck AM_TESTS_ENVIRONMENT='TERM=dumb'
cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
-TERM=dumb; export TERM
-expected_term=ansi; export expected_term
-mkcheck AM_TESTS_ENVIRONMENT='TERM=ansi'
-cat stdout | $FGREP "$esc" && Exit 1
-
:
am_parallel_tests=yes
. ./defs || Exit 1
-TERM=ansi; export TERM
-
esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
ok 2
END
-AM_COLOR_TESTS=always $MAKE check >stdout && { cat stdout; Exit 1; }
-cat stdout
-
test_color ()
{
# Not a useless use of cat; see above comments about grep.
# 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
+ if $FGREP '= Xalways; then' stdout; then
# Extra verbose make, resort to laxer checks.
# But we also want to check that the testsuite summary is not unduly
# colorized.
fi
}
-AM_COLOR_TESTS=always $MAKE check >stdout && { cat stdout; Exit 1; }
+# 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; }
cat stdout
test_color
-$MAKE -e check >stdout && { cat stdout; Exit 1; }
+TERM=ansi $MAKE -e check >stdout \
+ && { cat stdout; Exit 1; }
cat stdout
test_no_color