summaryrefslogtreecommitdiff
path: root/t/parallel-tests-reset-term.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-04-30 20:44:50 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-04-30 21:00:48 +0200
commitb105d40dc70fde616dd222c03ae642317fa205a6 (patch)
tree780c07fd5078d54e36d61735fd5b176f85276f30 /t/parallel-tests-reset-term.sh
parentd6294a1283a3d88665ca9ec1592e959517172e59 (diff)
downloadautomake-b105d40dc70fde616dd222c03ae642317fa205a6.tar.gz
color-tests: coloring can be forced on non-ANSI terminals as well
Before this change, colorization of testsuite output was suppressed whenever the terminal was recognized to be a "dumb" one, incapable of handling ANSI coloring (i.e., when the environment variable TERM had a value of "dumb"). This happened even when the AM_COLOR_TESTS variable was set to a value of "always". Such a behaviour was suboptimal and slightly confusing; in fact, if a user wants to force coloring of testsuite output that is being redirected to a regular file, he should be able to do so even if his terminal is not capable of handling ANSI colors -- in fact, such terminal wouldn't be involved with the testsuite output in any way, so why should it be allowed to influence it? Thus, we now enable coloring of test output whenever AM_COLOR_TESTS is set to "always", irrespective of the value of the TERM environment variable. * NEWS: Update. * lib/am/check.am [%?COLOR%] (am__tty_colors): Activate colorization of testsuite output whenever AM_COLOR_TESTS has the value of "always". * t/ax/tap-summary-aux.sh: Export the TERM environment variable to "dumb" when forcing colorization of the testsuite output; this should *not* prevent such colorization from taking place, and we want to check that this expectation really holds. * t/ax/testsuite-summary-checks.sh: Likewise. * t/color.sh: Likewise, and adjust some grepping checks. * t/tap-color.sh: Likewise. Also, remove redundant "make check" invocation since we are at it. * t/color2.sh: Likewise, and check that exporting TERM=dumb actually prevents testsuite output colorization when AM_COLOR_TESTS is unset. * t/parallel-tests-reset-term.sh: Relax, to prevent it from failing spuriously due to the new semantic. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/parallel-tests-reset-term.sh')
-rwxr-xr-xt/parallel-tests-reset-term.sh21
1 files changed, 4 insertions, 17 deletions
diff --git a/t/parallel-tests-reset-term.sh b/t/parallel-tests-reset-term.sh
index 6307f6e4b..53e542c27 100755
--- a/t/parallel-tests-reset-term.sh
+++ b/t/parallel-tests-reset-term.sh
@@ -22,6 +22,8 @@ am_parallel_tests=yes
esc='['
+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.
@@ -43,14 +45,13 @@ END
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
@@ -66,24 +67,10 @@ $AUTOCONF
$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
-
: