* master:
tests: avoid non-textual output in a '.log' file
tags: refactor to reduce code duplication (2)
tags: refactor to reduce code duplication (1)
tests: better name for a couple of tests
check: support colorized testsuite output by default
tags: unify recursion for tags targets with that of "usual" targets
+ Extra non-trivial edits:
* automake.in (handle_tests): Drop the '%COLOR%' transform in the
processing of both 'serial-tests.am' and 'parallel-tests.am', which
have superseded the 'check.am' from mainline Automake.
* lib/am/color-tests.am: Remove use of the '%?COLOR%' transform;
just act as if it were unconditionally TRUE.
(am__tty_colors_dummy): Merge into ...
(am__tty_colors): ... this.
* t/dist-formats.tap: Here. Otherwise, some inferior awk implementations,
like OpenIndiana /usr/xpg4/bin/awk, could be confused and cause spurious
errors in the testsuite harness.
* lib/am/tags.am (am__define_uniq_tagged_files): New variable,
factor out some code common to ...
(ctags-am, tags-am, ID): ... the recipes of these targets.
* lib/am/header-vars.am (am.chars.empty): This, move earlier. This both
fixes the associated comments (which referred to a variable defined above
it as "defined below"), and ensures that this variable is not used before
being defined (not a big deal in practice, since it expands to empty; but
better be consistent).
[ng] vars: names of iterating vars in $(foreach) loops shorter & simpler
In GNU make, after a "$(foreach x,...)" loop, the make variable $(x):
- is restored to its original variable it had before the 'foreach'
loop, if it was already set;
- re-unset otherwise.
This behaviour is checked by the recent spy test 't/spy-foreach.sh'.
This means that, in most situations, there's no actual need to use
a "namespace safe" variable name for the iterating variable in a
"$(foreach ...)" loop, because that variable won't linger in the
environment after the loop anyway.
* lib/am/compile.am, lib/am/header-vars.am, lib/am/parallel-tests.am,
lib/am/serial-tests.am: Adjust to use simpler variables names in their
foreach loops; for example, simply 'v' instead of 'am__v', etc.
[ng] spy: iteration variables in "$(foreach ...)" loops are temporary
* t/spy-foreach.sh: New test. Check that, after a "$(foreach x,...)"
loop, the make variable $(x) is:
- restored to the original variable it had before the 'foreach'
loop, if it was already set; and
- is re-unset otherwise.
The test 't/memoize.sh' was producing a '.log' file with few overly-long
lines (more than 12k characters long) and, when Solaris XPG4 awk was in
use, that was causing the 'test-driver.sh' script to experience a spurious
failure:
/usr/xpg4/bin/awk: line 382 (B): Record too long (LIMIT: 19999 bytes)
tap-driver.sh: fatal: I/O or internal error
* t/memoize.sh: Temporary disable shell tracing and make output in a few
places, to prevent the resulting '.log' file to contain overly long lines.
* master:
tests: avoid a spurious failure with Solaris /bin/sh
tests: fix buglet in t/missing3.sh
self tests: avoid spurious failures on older bash
tests: remove t/parallel-tests-many.sh (fixes spurious failure)
typofix: in a comment in the automake script
news: minor fixlets and reordering
+ Extra non-trivial edits:
* t/parallel-tests-many.sh: Do not deleted; keep the correct and
improved version from the 'ng/master' branch.
* t/subpkg.sh: Here: do not expect the C compiler to be simply
named 'cc'. This was causing spurious failures when $CC was
overridden at configure time or though config.site.
* ng/many-tests:
[ng] check: in recipes, don't use pipe when redirection suffices
[ng] recheck: don't exceed command line limits, even with many failed tests
[ng] coverage: recheck with many failed tests
[ng] check: refactor for less duplication and better performances
[ng] check: use awk rather than grep+xargs to count test results
[ng] parallel-tests: do not exceed command line length limits
[ng] coverage: testing with lots of test scripts
tests: avoid a spurious failure with Solaris /bin/sh
The /bin/sh shell on Solaris is dumb enough not to set the exit
status to 127 after the execution of a non-existing command is
attempted:
$ /bin/sh -c 'nonesuch'; echo stat = $?
/bin/sh: nonesuch: not found
stat = 1
This means that the missing script, when run through that shell,
cannot discriminate between a real failure of a maintainer tool
and a failure due to its absence. This is not a big deal in
practice (especially because all the 'missing' invocations in
our Makefiles are done with $(SHELL), and that is almost surely
set by configure to a proper POSIX shell), but was causing an
annoying failure in our testsuite. Fix it.
* t/missing3.sh: If 'missing' is run with a /bin/sh shell suffering
from the just-described bug, skip the check that would spuriously
fail due to that bug.
* t/missing3.sh: Be sure to use 'run_cmd' also in the first invocation
of 'missing', to ensure the stderr will actually be saved in a file we
can later grep.
* maint:
self tests: avoid spurious failures on older bash
tests: remove t/parallel-tests-many.sh (fixes spurious failure)
typofix: in a comment in the automake script
news: minor fixlets and reordering
* t/self-check-explicit-skips.sh: Remove or rework few checks for use
cases that are no more relevant nor supported now that we've got rid
of the need to use the 'Exit' function explicitly. Make the other
existing checks stricter.
That test was checking for automake#7868 "parallel-tests and command-line
length limit issue". That bug is still open, and the tests was xfailing.
What concerns us is that the test was also causing an annoying problem.
On Solaris 10, it produced a '.log' file with two overly-long lines (more
than 1 million characters long!) and that was causing the test harness to
experience spurious failures, with Solaris XPG4 awk complaining that:
/usr/xpg4/bin/awk: line 0 (NR=734): Record too long (LIMIT: 19999 bytes)
A little consideration shows that the bug#7868 checked by the culprit
test cannot be solved "by accident", e.g., by another bug fix or some
simple refactoring, so there is little added value in keeping the xfailing
test for it, if this causes other problems (and we've seen it does).
So we just remove the test. In case we ever manage to fix the bug in
mainline automake, we can copy over the similar test(s) from Automake-NG,
which has actually managed to fix the bug (and have simpler test cases
for it).
* t/parallel-tests-many.sh: Delete.
* t/list-of-tests.mk (XFAIL_TESTS, handwritten_TESTS): Remove it.
check: support colorized testsuite output by default
Fixes automake bug#11855.
With this change, we make the 'color-tests' option enabled by default.
That option remains still silently accepted as a no-op, for backward
compatibility.
The developer of a package is still free to disable testsuite coloring on
a per-makefile basis (by adding "AM_COLOR_TESTS = no" to the Makefile.am)
or on a whole-project basis (by AC_SUBST'ing AM_COLOR_TESTS to "no" in
configure.ac). But now the user will be able to request the testsuite
output to be colorized, if he really wants to:
# With GNU make:
make AM_COLOR_TESTS=yes check
# With non-GNU make:
make AM_COLOR_TESTS=yes AM_MAKEFLAGS=AM_COLOR_TESTS=yes check
* NEWS: Update.
* doc/automake.texi: Updated, and some related minor reformatting
and rewording.
* automake.in (handle_tests): No need to pass the transform '%COLOR%'
when processing "check.am".
* lib/am/parallel-tests.am: Remove use of the '%?COLOR%' transform;
just act as if it were unconditionally TRUE.
* t/color.sh: No need to specify 'color-tests' in 'AUTOMAKE_OPTIONS'
nor in 'AM_INIT_AUTOMAKE'.
* t/ax/testsuite-summary-checks.sh: Likewise.
* t/ax/tap-summary-aux.sh: Likewise.
* t/color2.sh: Likewise. Also, ensure that colorized testsuite output
can be disabled by default by calling "AC_SUBST([AM_COLOR_TESTS], [no])".
* t/tap-realtime.sh: Define 'AM_COLOR_TESTS' to "no" in Makefile.am, to
avoid spurious colorization of the output due to the use of the 'expect'
program.
* t/color-tests-opt.sh: New test, check that the 'color-tests' option is
still recognized as a no-op.
* t/list-of-tests.mk: Add the new test.
* lib/am/clean.am: In here, about the need to break too long lists
of files to be cleaned in order to avoid exceeding command line
limits. We already do that successfully!
* t/spy-pattern-rules.sh : Fix heading comments to be more faithful
about what the test really checks. Add more tests checking that, in
case of overlapping pattern rules, the one "more specific", i.e.,
with the shortest target stem, wins.
[ng] check: in recipes, don't use pipe when redirection suffices
Instead of the botched idiom:
while read c; do echo $c; done <file | command
use the simpler and much better one:
command <file
Not only the latter is simpler and marginally more efficient, but is also
better at catching possible unexpected I/O errors; while in the former,
the exit status of the while loop (which might have revealed such errors)
was lost in the pipeline.
* lib/am/parallel-tests.am ($(TEST_SUITE_LOG), recheck): Use the better
idiom.
[ng] recheck: don't exceed command line limits, even with many failed tests
Related to automake bug#7868.
* lib/am/parallel-tests.sh (recheck): Arrange recursive make invocation
to pass the list of tests to be rechecked in the make standard input
rather than on the make command line.
(am__test_bases): Only define if not already set, to make the new idiom
referenced above work as expected.
* Makefile.am (XFAIL_TESTS): Remove 't/parallel-tests-many.sh' once
again.
* t/parallel-tests-many.sh: Extend to check that the 'recheck' target
works even when a huge number of tests (~ 30k) have failed in the
previous testsuite run. Currently this doesn't work, and causes the
test to fail, so list it ...
* Makefile.am (XFAIL_TESTS): ... in here.
tags: unify recursion for tags targets with that of "usual" targets
This change has a side effect: now any failure of the 'tags', 'ctags',
'cscope' and 'cscopelist' targets in a subdirectory will cause the
recursive command issued from the top directory to fail. We believe
that this behavioural change is not only justified by the simplification
this patch entails, but actually offers better semantics: ignoring
failures by default is never a good idea, and with make, the user can
anyway order the completion of commands in the face of possible failures
with the '-k' option.
* NEWS: Update.
* automake.in (%required_targets): Add keys 'cscopelist-am', 'tags-am'
and 'ctags-am'.
(handle_tags): Greatly simplified, the major part of the handling of
recursion for the 'tags', 'ctags' and 'cscopelist' now moved out to ...
* lib/am/tags.am: ... this file, that has been adjusted and extended
accordingly.
* t/maken3.sh: Remove testing of the 'TAGS' target, that is now just
an alias to 'tags'. Without this change, this test would spuriously
fail.
[ng] check: refactor for less duplication and better performances
* lib/am/parallel-tests.am (am__count_test_results): Adjust this awk
program to emit a shell snippet to be executed by the calling recipe ...
($(TEST_SUITE_LOG)): ... here. This avoid the need to call the program
in $(am__count_test_results) once for each valid test result.
[ng] parallel-tests: do not exceed command line length limits
Fixes automake bug#7868.
Two things worth noting:
+ a "make recheck" issued after a huge number of tests have failed
can still hit command-line length issues;
+ the check-recipes now contain (first among the Automake-generated
recipes) a use of the 'xargs' utility.
These issues will likely be tackled by later patches.
* Makefile.am (XFAIL_TESTS): Remove 't/parallel-tests-many.sh'.
* lib/am/clean.am (.am.clean-cmd.f, .am.clean-cmd.d, .am.rm-f,
.am.rm-rf): Move their definitions ...
* lib/am/header-vars.am: ... here, because we need to use them ...
* lib/am/parallel-tests.am: ... here as well.
(am.test-harness.workdir, am.setup-test-harness-workdir,
am.test-harness.append-to-list-of-bases): New internal variables.
Use them to avoid hitting command-line length limits ...
($(TEST_SUITE_LOG), recheck): ... in this rules ...
(am__remove_if_not_lazy_check): ... and in the shell code defined
by this internal variable.
* t/parallel-tests-many.sh: Simplify and enhance. Among other things,
this test now tries running ~ 30k tests. Currently fails on several
systems (e.g., Linux 2.6.30 on i686, Solaris 10 on i86pc).
[ng] automake: new function &almost_verbatim (small refactoring)
* automake.in (almost_verbatim): New function, thin wrapper around
'&preprocess_file'. It requires just the name of the fragment to
preprocess (assuming it is one provided by automake, and thus taking
care to prepend the "$libdir/am/" path and append the ".am" extension
automatically), and then automatically append the processed content
to the '$output_verbatim' global variable.
(handle_all_and_check, handle_install, handle_texinfo): Adjust to use
'&almost_verbatim' instead of '&preprocess_file'.
* automake.in (generate_makefile): In here, about the generated
Makefile baling out if '$(am__seen_error)' has been set by some
previous function call.
* t/longline.sh: Use "$i", not bare "i", to reference the value of
the shell variable 'i' in a $((...)) expression. Issue revealed by
a failure with dash 0.5.2.
* t/dist-many2.sh: We don't fake the command line length for the shell
at "max 2000 chars", but at at "max 4000 chars". Adjust heading comment
accordingly.
[ng] vars: names for internal make variables: 'am.foo' and 'am.foo.bar-baz'
That is the new preferred naming scheme: 'am.foo' where we would
have previously used something like 'am__foo', and 'am.foo.bar-baz'
where we would have previously used something like 'am__foo_bar_baz'
or 'am__foo__bar_baz'.
We should start using the new naming to do so in future commits. But
we should also avid a sweeping rename for now, to minimize conflicts
with the mainline Automake codebases, which (for portability reason)
must still limit itself to the use of the 'am__' prefix.
* HACKING: Adjust. Also, remove now-irrelevant advice about the
problem of an old vendor make (NEWS-OS 4.2R) with variables whose
name start with an underscore.
* ng/dist-many:
[ng] dist: do not exceed command line length limits, even with many files
[ng] coverage: distributing lots of files
[ng] dist: memoize some internal variables
* master: (23 commits)
fixup: delete "# serial" line in m4/amversion.in
news: update about recent ylwrap changes and fixes
m4: get rid of "# serial" lines
configure: ${#param} must be supported by the shell for the testsuite
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
news: mention fixed testsuite weaknesses
news: bump, for future 1.12.3
tests: verify the shell test scripts are syntactically valid
tests: don't use C instead of C++ compiler on case-insensitive platforms
tests: avoid spurious TAP errors on Mac OS X 10.7
tests: fix spurious failure in aclocal7.sh on fast machines
* maint:
fixup: delete "# serial" line in m4/amversion.in
news: update about recent ylwrap changes and fixes
m4: get rid of "# serial" lines
configure: ${#param} must be supported by the shell for the testsuite
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
* yacc-work:
news: update about recent ylwrap changes and fixes
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
The "#serial" lines are only considered by aclocal for the system-wide
third-party '.m4' files, not for the Automake-provided ones. So they
serve no real purpose in the Automake '.m4' files.
In addition, now that we use git and topic branches, and that we are also
writing the Automake-NG fork, the "#serial" lines are becoming more and
more unreliable (e.g., different version of the same file in different
branches can easily end up having the same serial numbers).
So let's just nuke all the "#serial" lines. See also automake bug#11932.