summaryrefslogtreecommitdiff
path: root/lib/am/check.am
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 /lib/am/check.am
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 'lib/am/check.am')
-rw-r--r--lib/am/check.am38
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/am/check.am b/lib/am/check.am
index 78665708d..73febb1b6 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -18,23 +18,27 @@ am__tty_colors_dummy = \
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=''; \
- grn=''; \
- lgn=''; \
- blu=''; \
- mgn=''; \
- brg=''; \
- std=''; \
+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=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
}
else !%?COLOR%
am__tty_colors = $(am__tty_colors_dummy)