diff options
author | Bert Wesarg <bert.wesarg@googlemail.com> | 2011-06-17 21:59:52 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-06-20 10:25:03 +0200 |
commit | b8c2b69913b652bcfd4665b041f11d8b5316da2b (patch) | |
tree | 735c1224ab5ac0e4aa64d3366d3472babd25cb2f /lib/Automake/tests | |
parent | 60cd9bc070d62bb9046298792bf344d233620a14 (diff) | |
download | automake-b8c2b69913b652bcfd4665b041f11d8b5316da2b.tar.gz |
check: don't use multi-line coloring for the report
"less -R" can't handle multi-line coloring as it is done for the
check reports of the serial and parallel testsuite, because of
performance reasons. Thus, color each line of the check report
by its own.
* lib/am/check.am (am__text_box): Accept colors for lines, and
color each line by its own.
[%?PARALLEL_TESTS%] $(TEST_SUITE_LOG): Let am__text_box handle
the line coloring.
[!%?PARALLEL_TESTS%] $(check-TESTS): Color each report line by
its own.
* THANKS: Update.
Diffstat (limited to 'lib/Automake/tests')
-rw-r--r-- | lib/Automake/tests/Makefile.in | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 7ed17d61e..2f553ede0 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -105,15 +105,21 @@ am__base_list = \ am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//' am__rst_section = sed 'p;s/./=/g;p;g' # Put stdin (possibly several lines separated by ". ") in a box. -am__text_box = $(AWK) '{ \ - n = split($$0, lines, "\\. "); max = 0; \ - for (i = 1; i <= n; ++i) \ - if (max < length(lines[i])) \ - max = length(lines[i]); \ - for (i = 0; i < max; ++i) line = line "="; \ - print line; \ - for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\ - print line; \ +# Prefix each line by 'col' and terminate each with 'std', for coloring. +# Multi line coloring is problematic with "less -R", so we really need +# to color each line individually. +am__text_box = $(AWK) '{ \ + n = split($$0, lines, "\\. "); max = 0; \ + for (i = 1; i <= n; ++i) \ + if (max < length(lines[i])) \ + max = length(lines[i]); \ + for (i = 0; i < max; ++i) \ + line = line "="; \ + print col line std; \ + for (i = 1; i <= n; ++i) \ + if (lines[i]) \ + print col lines[i] std; \ + print col line std; \ }' # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it @@ -394,12 +400,11 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG); \ $(am__tty_colors); \ if $$exit; then \ - echo $(ECHO_N) "$$grn$(ECHO_C)"; \ + col="$$grn"; \ else \ - echo $(ECHO_N) "$$red$(ECHO_C)"; \ + col="$$red"; \ fi; \ - echo "$$msg" | $(am__text_box); \ - echo $(ECHO_N) "$$std$(ECHO_C)"; \ + echo "$$msg" | $(am__text_box) "col=$$col" "std=$$std"; \ $$exit # Run all the tests. |