From: Bert Wesarg Date: Fri, 17 Jun 2011 19:59:52 +0000 (+0200) Subject: check: don't use multi-line coloring for the report X-Git-Tag: ng-0.5a~164^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c2b69913b652bcfd4665b041f11d8b5316da2b;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index c5652dadc..d79a84832 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-06-20 Bert Wesarg (tiny change) + + 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. + 2011-06-18 Stefano Lattarini docs: AM_DISTCHECK_CONFIGURE_FLAGS is for corner cases diff --git a/THANKS b/THANKS index 16a1ef806..3d71419e4 100644 --- a/THANKS +++ b/THANKS @@ -37,6 +37,7 @@ Benoit Sigoure tsuna@lrde.epita.fr Bernard Giroud bernard.giroud@creditlyonnais.ch Bernard Urban Bernard.Urban@meteo.fr Bernd Jendrissek berndfoobar@users.sourceforge.net +Bert Wesarg bert.wesarg@googlemail.com Bill Currie bcurrie@tssc.co.nz Bill Davidson bill@kayhay.com Bill Fenner fenner@parc.xerox.com 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. diff --git a/lib/am/check.am b/lib/am/check.am index 4d10ce901..0b54312a6 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -75,15 +75,21 @@ 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, @@ -213,12 +219,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 RECHECK_LOGS = $(TEST_LOGS) @@ -398,14 +403,17 @@ check-TESTS: $(TESTS) fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ +## Multi line coloring is problematic with "less -R", so we really need +## to color each line individually. + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi diff --git a/tests/Makefile.in b/tests/Makefile.in index 5ca3f6a16..ba57aa2a6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -108,15 +108,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 @@ -1252,12 +1258,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.