From: Ralf Wildenhues Date: Sun, 22 Mar 2009 08:39:14 +0000 (+0100) Subject: Minor optimization in parallel-tests text box creation. X-Git-Tag: v1.10b~4^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64b35b506420a7e9a00af47fe8d0c283759aa4f6;p=thirdparty%2Fautomake.git Minor optimization in parallel-tests text box creation. * lib/am/check.am [PARALLEL-TESTS] (am__text_box): Use only one awk invocation, rather than several tools, to create a text box. Suggestion from Akim Demaille. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 659167c75..8204083be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-22 Ralf Wildenhues + + Minor optimization in parallel-tests text box creation. + * lib/am/check.am [PARALLEL-TESTS] (am__text_box): Use only one + awk invocation, rather than several tools, to create a text box. + Suggestion from Akim Demaille. + 2009-03-11 Ralf Wildenhues Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation. diff --git a/lib/am/check.am b/lib/am/check.am index fcb9add2a..fc9eb69b8 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -75,13 +75,15 @@ 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 = { nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \ - sed "s/\\. /\\$$nl/g"; } | sed '/^$$/d' | \ -$(AWK) '{ if (final) final = final "\n" $$0; else final = $$0; }\ -max < length($$0) { max = length($$0); } \ -END { \ - for (i = 0; i < max; ++i) line = line "="; \ - print line; print final; print line; \ +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; \ }' # Solaris 10 'make', and several other traditional 'make' implementations, diff --git a/tests/Makefile.in b/tests/Makefile.in index 6a293a859..213cab250 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -92,13 +92,15 @@ 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 = { nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \ - sed "s/\\. /\\$$nl/g"; } | sed '/^$$/d' | \ -$(AWK) '{ if (final) final = final "\n" $$0; else final = $$0; }\ -max < length($$0) { max = length($$0); } \ -END { \ - for (i = 0; i < max; ++i) line = line "="; \ - print line; print final; print line; \ +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; \ }' # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL). This contradicts POSIX. Work around the problem