]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years agoautomake: '--add-missing' is on by default experimental/ng/incompat-simplifications
Stefano Lattarini [Thu, 26 Jul 2012 20:42:56 +0000 (22:42 +0200)] 
automake: '--add-missing' is on by default

This commit modifies the automake script will always act as if the
'--add-missing' option were give, and simplifies the documentation
accordingly.

Future commits will take care of cleaning up the code accordingly.

The new semantics introduced with this change should have ideally
been the default in automake mainline as well, but they are not,
likely for historical reasons (as is the case for too many Automake
warts).

The new semantics also prepare the way for an exciting planning
change: the distribution of (at first only few) makefile fragments
to be included at make runtime in the Automake-generated Makefiles,
instead of having their contents copied over and over in said
Makefiles.

* automake.in ($add_missing): Define to '1' unconditionally.
(parse_arguments): The '-a' a.k.a. '--add-missing' option is
now a no-op.
* doc/automake-ng.texi: Adjust, in particular with the addition
of ...
(Auxiliary files): ... this new node.
* NG-NEWS: Update.
* t/add-missing.tap: Simplify: don't check that , if any required
auxiliary file is missing and automake is called without the '-a'
or '--add-missing' option, it complains and error out; this is not
the case anymore.  Also, don't call automake with the '-a' or
'--add-missing' option; there's no need to now.
* t/dist-auxfile.sh: Adjust.
* t/license2.sh: Likewise.
* t/per-target-flags.sh: Likewise.
* t/python.sh: Likewise.
* t/missing-auxfile-stops-makefiles-creation.sh: Remove as obsolete.
* t/mdate.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoautomake: remove support for threaded execution
Stefano Lattarini [Thu, 26 Jul 2012 20:14:59 +0000 (22:14 +0200)] 
automake: remove support for threaded execution

First, It add lots of complexity to the Automake script, which might
get in the way of future refactorings.

Also, the performance enhancements it offers seems to be fairly
limited:
<http://lists.gnu.org/archive/html/automake/2009-11/msg00004.html>
albeit not excessively so:
<http://www.open-mpi.org/community/lists/devel/2010/09/8524.php>

In the end, the most relevant reason for this change is that we want to
reach a point, during the yet-to-come maturity of Automake-NG, where it
will be just a thin layer around the provided scripts and makefile
fragments (with just a *tiny* smattering of preprocessing), as well as
around autom4te (for the proper parsing of configure.ac).  At such a
point, a threaded execution would bring no real benefit.

Oh, and we should really be pushing peoples towards non-recursive
build systems, where they just have one 'Makefile.am', and thus
threading on different 'Makefile.am's is irrelevant ;-)

* NG-NEWS: Update.
* doc/automake-ng.texi, NG-NEWS: Likewise.
* configure.ac: Don't check for 'ithreads' support in perl.
Drop AC_SUBST 'PERL_THREADS'.
* bootstrap.sh (PERL_THREADS): Don't define.
(dosubst): Don't substitute it.
* lib/Automake/Config.in ($perl_threads): Define no more.
(@EXPORT): Drop it.
* aclocal.in ($perl_threads): Remove, no more needed.
* automake.in (BEGIN) [$perl_threads]: Don't require nor import
the 'threads' and 'Thread::Queue' modules.
(QUEUE_MESSAGE, QUEUE_CONF_FILE, QUEUE_LOCATION, QUEUE_STRING):
Delete constants.
($required_conf_file_queue): Delete variable.
($nthreads): Likewise, and thus ...
(get_number_of_threads): ... delete this function, whose only
purpose was to initialize that variable.
(handle_makefiles_serial): Delete, its body inlined in the main
code.
(require_file_internal): Don't take the '$QUEUE' argument, nor
handle threading/serialization calling back ...
(queue_required_file_check_or_copy): ... this function, which
has thus been removed.
(require_libsource_with_macro): Adjust 'require_file_internal'
call to new signature.
(require_conf_file): Likewise, in the process dropping any
handling of threading/serialization.
(handle_makefiles_threaded): This is no more called anywhere,
so delete it, together with ...
(require_queued_file_check_or_copy): ... this, which has in
that its only caller.
* lib/Automake/Location.pm (serialize, deserialize): Delete
as unused.
* lib/Automake/Channels.pm (setup_channel_queue,
pop_channel_queue): Likewise.
(@EXPORT): Adjust.
(BEGIN) [$perl_threads]: Don't require nor import 'threads'.
(%_default_options): Remove 'ordered', 'queue' and 'queue_key'
keys, that were only required for serialization during threaded
Automake.
(_merge_options, _print_message): No need to handle those
options.
Adjust creation of channels 'automake', 'verb' and 'fatal'.
(_enqueue, _dequeue): Delete as unused.
(msg): Adjust a comment.
(verb): Don't try to display informations about the current
thread.
* lib/Automake/DisjConditions.pm (CLONE): Delete, no more
needed.
* t/ax/am-test-lib.sh (require_tool): Drop handing of
requirement 'perl-threads'; it is not used by any test now.
* t/parallel-am.sh: Remove as obsolete.
* t/parallel-am2.sh: Likewise.
* t/parallel-am3.sh: Likewise.
* t/pm/Condition-t.pl: Likewise.
* t/pm/DisjConditions-t.pl: Likewise.
* Makefile.am (check-coverage-run, recheck-coverage-run): Don't
export 'WANT_NO_THREADS' to "yes", nor unset 'AUTOMAKE_JOBS'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Thu, 26 Jul 2012 17:01:49 +0000 (19:01 +0200)] 
Merge branch 'master' into ng/master

* master: (39 commits)
  typofix: in a comment in Makefile.am
  maintcheck: fixup list of files in $(xdefs)
  tests: never source test-defs.sh directly, source test-lib.sh instead
  runtest: sanitize test environment
  tests: remove an obsolescent self test
  tests: "am_using_tap=yes" -> "am_test_protocol=tap"
  tests: protect test libs against multiple inclusion
  configure: testsuite shell can return early from "dot-sourced" files
  tests: move sanitization and "Bournification" in the generic test lib
  tests: source test defs in the generic test lib
  test defs: no need to re-add $srcdir/t/ax to $PATH
  tests: split test libs into "generic" and "automake-specific"
  test setup: move actual calling of testsuite setup in ./defs
  test setup: merge definitions of function for simple tests
  test init: refactor: new function 'am_test_setup'
  test init: refactor: move displaying of debugging info later
  test init: refactor: new function 'am_setup_testdir'
  test init: refactor: new function 'am_set_exit_traps'
  configure: testsuite shell set exit traps in shell functions
  test init: refactor: new function 'am_exit_trap'
  ...

+ Extra non-trivial edits:

* Makefile.am (perf_TESTS): Define here, as 't/list-of-tests.mk' is gone
in the 'ng/master' branch.
(all_TESTS): Don't list tests in 't/perf'; this reflects the removal of
$(perf_TESTS) from $(handwritten_TESTS) done in 't/list-of-tests.mk' on
the 'master' branch.

* t/depcomp-shuffle.sh: Source 'test-lib.sh', not './defs-static'.
Also, simply use:
    . depcomp-shuffle.sh
instead of:
    . "$am_testauxdir"/depcomp-shuffle.sh
to source the helper shell script 'depcomp-shuffle.sh'.  See recent
commit 'v1.12.2-49-g42fb45b' for a rationale.
* t/depcomp-shuffle-sub-vpath.sh: Likewise.
* t/depcomp-shuffle-sub.sh: Likewise.
* t/depcomp-shuffle-vpath.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotypofix: in a comment in Makefile.am
Stefano Lattarini [Thu, 26 Jul 2012 16:27:15 +0000 (18:27 +0200)] 
typofix: in a comment in Makefile.am

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 26 Jul 2012 16:16:47 +0000 (18:16 +0200)] 
Merge branch 'maint'

* maint: (38 commits)
  maintcheck: fixup list of files in $(xdefs)
  tests: never source test-defs.sh directly, source test-lib.sh instead
  runtest: sanitize test environment
  tests: remove an obsolescent self test
  tests: "am_using_tap=yes" -> "am_test_protocol=tap"
  tests: protect test libs against multiple inclusion
  configure: testsuite shell can return early from "dot-sourced" files
  tests: move sanitization and "Bournification" in the generic test lib
  tests: source test defs in the generic test lib
  test defs: no need to re-add $srcdir/t/ax to $PATH
  tests: split test libs into "generic" and "automake-specific"
  test setup: move actual calling of testsuite setup in ./defs
  test setup: merge definitions of function for simple tests
  test init: refactor: new function 'am_test_setup'
  test init: refactor: move displaying of debugging info later
  test init: refactor: new function 'am_setup_testdir'
  test init: refactor: new function 'am_set_exit_traps'
  configure: testsuite shell set exit traps in shell functions
  test init: refactor: new function 'am_exit_trap'
  test init: refactor: new function 'process_requirements'
  ...

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'testsuite-refactor' into maint
Stefano Lattarini [Thu, 26 Jul 2012 16:14:18 +0000 (18:14 +0200)] 
Merge branch 'testsuite-refactor' into maint

* testsuite-refactor: (33 commits)
  maintcheck: fixup list of files in $(xdefs)
  tests: never source test-defs.sh directly, source test-lib.sh instead
  runtest: sanitize test environment
  tests: remove an obsolescent self test
  tests: "am_using_tap=yes" -> "am_test_protocol=tap"
  tests: protect test libs against multiple inclusion
  configure: testsuite shell can return early from "dot-sourced" files
  tests: move sanitization and "Bournification" in the generic test lib
  tests: source test defs in the generic test lib
  test defs: no need to re-add $srcdir/t/ax to $PATH
  tests: split test libs into "generic" and "automake-specific"
  test setup: move actual calling of testsuite setup in ./defs
  test setup: merge definitions of function for simple tests
  test init: refactor: new function 'am_test_setup'
  test init: refactor: move displaying of debugging info later
  test init: refactor: new function 'am_setup_testdir'
  test init: refactor: new function 'am_set_exit_traps'
  configure: testsuite shell set exit traps in shell functions
  test init: refactor: new function 'am_exit_trap'
  test init: refactor: new function 'process_requirements'
  ...

13 years agoMerge branch 'fix-pr12041' into maint
Stefano Lattarini [Thu, 26 Jul 2012 16:07:17 +0000 (18:07 +0200)] 
Merge branch 'fix-pr12041' into maint

* fix-pr12041:
  tests: avoid spurious failure when running as root

13 years agomaintcheck: fixup list of files in $(xdefs)
Stefano Lattarini [Thu, 26 Jul 2012 12:16:42 +0000 (14:16 +0200)] 
maintcheck: fixup list of files in $(xdefs)

syntax-checks.mk (xdefs): Adjust to recent changes: add 't/ax/test-lib.sh'
and 't/ax/test-lib.sh', remove the now-deleted 't/ax/test-init.sh'

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: never source test-defs.sh directly, source test-lib.sh instead
Stefano Lattarini [Thu, 26 Jul 2012 10:50:32 +0000 (12:50 +0200)] 
tests: never source test-defs.sh directly, source test-lib.sh instead

After the recent re-organization, sourcing 'test-defs.sh' directly might
not work well and cause spurious failures or other unexpected behaviours.
We should source 'test-lib.sh' instead, which contains not more direct
code execution (only definition of shell variables/functions, or sourcing
of other '*.sh' with the same property), is protected against multiple
inclusions, and sources 'test-defs.sh' automatically in in a proper way.

* t/testsuite-summary-count.sh, t/tap-summary.sh, t/tap-summary-color.sh,
t/testsuite-summary-color.sh: Source 'test-lib.sh', not 'test-defs.sh'.
* gen-testsuite-part: Likewise, in the generated wrapper scripts.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: sanitize test environment
Stefano Lattarini [Thu, 26 Jul 2012 09:04:31 +0000 (11:04 +0200)] 
runtest: sanitize test environment

* runtest.in: Here, similarly to what is done by AM_TESTS_ENVIRONMENT
in Makefile.am, unset variables that should be under the complete control
of the test framework, and that could create havoc if inherited from the
environment.  This remove the need to check against possible environment
"pollution" ...
* t/ax/test-defs.in: ... in here.
* Makefile.am (AM_TESTS_ENVIRONMENT): Add a comment about the need of
synchronization with 'runtest.in'.
* t/self-check-env-sanitize.tap: Remove as obsolete.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: remove an obsolescent self test
Stefano Lattarini [Thu, 26 Jul 2012 08:45:43 +0000 (10:45 +0200)] 
tests: remove an obsolescent self test

* t/self-check-tap.sh: This.  The recent reorganization and code
moving between 'test-defs.sh' and 'test-lib.sh' has made it
brittle and prone to failures.  Since the usefulness of this self
check is extremely limited, it's not worth trying to fix it. Just
remove it.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: "am_using_tap=yes" -> "am_test_protocol=tap"
Stefano Lattarini [Thu, 26 Jul 2012 08:35:09 +0000 (10:35 +0200)] 
tests: "am_using_tap=yes" -> "am_test_protocol=tap"

And similarly, "am_using_tap=no" -> "am_test_protocol=none".

The new '$am_test_protocol' name is clearer, and will allow the easy
addition of further test protocols in the future.  This is not truly
relevant for automake, but we are trying to make some parts of our
testsuite framework as general as possible, in view of a future move
to a more generic project like Gnulib.

* Makefile.am, t/ax/am-test-lib.sh, t/ax/test-defs.in, t/ax/test-lib.sh,
t/self-check-env-sanitize.tap, t/self-check-tap.sh: Adjust.
* syntax-checks.mk (sc_tests_obsolete_variables): Add 'am_using_tap' to
the list of obsolete variables to check against.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: protect test libs against multiple inclusion
Stefano Lattarini [Thu, 26 Jul 2012 10:21:40 +0000 (12:21 +0200)] 
tests: protect test libs against multiple inclusion

* t/ax/test-lib.sh, t/ax/am-test-lib.sh: Return early if already sourced.
Use the witness variables '$test_lib_sourced' and '$am_test_lib_sourced',
respectively, for this purpose.
* runtest.in, Makefile.am (AM_TESTS_ENVIRONMENT): Unset 'test_lib_sourced'
and 'am_test_lib_sourced', to avoid interferences from the environment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoconfigure: testsuite shell can return early from "dot-sourced" files
Stefano Lattarini [Wed, 25 Jul 2012 18:40:21 +0000 (20:40 +0200)] 
configure: testsuite shell can return early from "dot-sourced" files

* configure.ac: Check that the shell selected to run the test
scripts can call 'return' form within a file being sourced
with the '.' built-in.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: move sanitization and "Bournification" in the generic test lib
Stefano Lattarini [Thu, 26 Jul 2012 08:22:52 +0000 (10:22 +0200)] 
tests: move sanitization and "Bournification" in the generic test lib

* t/ax/test-defs.sh: From here ...
* t/ax/test-lib.sh: ... to here.  Also move the initialization of
'$argv0' and '$me'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: source test defs in the generic test lib
Stefano Lattarini [Thu, 26 Jul 2012 08:09:04 +0000 (10:09 +0200)] 
tests: source test defs in the generic test lib

* t/ax/test-lib.sh: That is, here ...
* defs: ... rather than here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest defs: no need to re-add $srcdir/t/ax to $PATH
Stefano Lattarini [Thu, 26 Jul 2012 08:03:51 +0000 (10:03 +0200)] 
test defs: no need to re-add $srcdir/t/ax to $PATH

* t/ax/test-defs.sh: Here.  That is already done by both 'runtest' and
AM_TESTS_ENVIRONMENT, and the presence of '$srcdir/t/ax' in $PATH is
anyway required, after the recent changes, for our testsuite framework
to work at all.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: split test libs into "generic" and "automake-specific"
Stefano Lattarini [Wed, 25 Jul 2012 20:49:02 +0000 (22:49 +0200)] 
tests: split test libs into "generic" and "automake-specific"

This is the first step in the quest to merge the generically useful
parts of our test suite framework in a more generic project, like
Gnulib.  Time will tell if we'll succeed, and whether the success will
be worth the extra hassle.

* t/ax/test-init.sh: Split out ...
* t/ax/am-test-lib.sh, t/ax/test-lib.sh: ... into these two tests.
* defs, Makefile.am: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest setup: move actual calling of testsuite setup in ./defs
Stefano Lattarini [Wed, 25 Jul 2012 19:12:30 +0000 (21:12 +0200)] 
test setup: move actual calling of testsuite setup in ./defs

* t/ax/test-init.sh: Move call to 'am_test_setup' ...
* defs: ... here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest setup: merge definitions of function for simple tests
Stefano Lattarini [Wed, 25 Jul 2012 19:04:30 +0000 (21:04 +0200)] 
test setup: merge definitions of function for simple tests

* t/ax/plain-functions.sh: Delete, moving the definitions of ...
($stderr_fileno_): ... this variable ...
(warn_, fail_, skip_, skip_all_, fatal_, framework_failure_): ... and
these functions ...
* t/ax/test-init.sh: ... in here.  This allow us to use those functions
earlier in this file (instead of having to duplicate their behaviour
with inlined code).  The TAP-based tests are still able to override these
functions later to their TAP-enhanced equivalents when 'tap-functions.sh'
is sourced.
* Makefile.am (dist_noinst_DATA): Remove 't/ax/plain-functions.sh'.
* t/ax/tap-functions.sh: Adjust a comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'am_test_setup'
Stefano Lattarini [Wed, 25 Jul 2012 18:31:47 +0000 (20:31 +0200)] 
test init: refactor: new function 'am_test_setup'

* t/ax/test-init.sh (am_test_setup): Here.
Call it from the main code.  Remove other calls of functions and
settings that are now duly called by 'am_test_setup'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: move displaying of debugging info later
Stefano Lattarini [Wed, 25 Jul 2012 18:25:55 +0000 (20:25 +0200)] 
test init: refactor: move displaying of debugging info later

* t/ax/test-init.sh: Here, about the values of $PATH, $am_using_tap
and $am_running_installcheck.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'am_setup_testdir'
Stefano Lattarini [Wed, 25 Jul 2012 18:20:09 +0000 (20:20 +0200)] 
test init: refactor: new function 'am_setup_testdir'

* t/ax/test-init.sh (am_setup_testdir): Here.
Use it instead of inlining its contents in the main code.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'am_set_exit_traps'
Stefano Lattarini [Wed, 25 Jul 2012 18:17:46 +0000 (20:17 +0200)] 
test init: refactor: new function 'am_set_exit_traps'

* t/ax/test-init.sh (am_set_exit_traps): Here.
(trap): Use it instead of inlining the cleanup/finalization code.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoconfigure: testsuite shell set exit traps in shell functions
Stefano Lattarini [Wed, 25 Jul 2012 17:51:27 +0000 (19:51 +0200)] 
configure: testsuite shell set exit traps in shell functions

* configure.ac: Check that the shell selected to run the test
scripts can set an exit trap in a shell function, without having
that trap executed at the termination of the function rather
than of the scripts.  According to the Autoconf manual, at least
AUX 5.3 /bin/sh suffers of such a bug.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'am_exit_trap'
Stefano Lattarini [Wed, 25 Jul 2012 17:45:31 +0000 (19:45 +0200)] 
test init: refactor: new function 'am_exit_trap'

* t/ax/test-init.sh (am_exit_trap): Here.
(trap): Use it instead of inlining the cleanup/finialization code.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'process_requirements'
Stefano Lattarini [Wed, 25 Jul 2012 17:41:57 +0000 (19:41 +0200)] 
test init: refactor: new function 'process_requirements'

* t/ax/test-init.sh (process_requirements): Here.
Use it in to check that the tools in $required are present.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: refactor: new function 'require_tool'
Stefano Lattarini [Wed, 25 Jul 2012 17:23:29 +0000 (19:23 +0200)] 
test init: refactor: new function 'require_tool'

* t/ax/test-init.sh (require_tool): Here.
Use it in the loop in the prerequisites in $required.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest init: remove a couple of paranoid sanity checks
Stefano Lattarini [Wed, 25 Jul 2012 16:49:50 +0000 (18:49 +0200)] 
test init: remove a couple of paranoid sanity checks

* t/ax/test-init.sh: Here, about 'am_top_srcdir' and 'am_top_builddir';
the values of those variables are AC_SUBST'd, so it's nigh impossible
for the to be wrong or get "messed up".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: simplify sourcing of helper shell files
Stefano Lattarini [Wed, 25 Jul 2012 22:20:03 +0000 (00:20 +0200)] 
tests: simplify sourcing of helper shell files

Now that the early $PATH setup in both 'runtest' and AM_TESTS_ENVIRONMENT
allow the '.' built-in to find to-be-sourced shell scripts in the 't/ax/'
directory automatically, we can simplify several usages like:

   . "$am_testauxdir"/foo.sh

to just:

   . foo.sh

Also, because our test scripts run with the 'errexit' flag active, and
because POSIX mandates that, when the '.' built-in is used,

   ... if no readable file is found, a non-interactive shell shall abort ...

we can further simplify usages like:

    . "$am_testauxdir"/foo.sh || fatal_ "sourcing foo.sh"

once again to to just:

    . foo.sh

* ./defs, several tests: Adjusted.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest defs: move in 't/ax/test-defs.sh'
Stefano Lattarini [Wed, 25 Jul 2012 16:14:23 +0000 (18:14 +0200)] 
test defs: move in 't/ax/test-defs.sh'

We can do so with minimal churn, now that the early setup of $PATH in
both 'runtest' and AM_TESTS_ENVIRONMENT allow the '.' built-in to find
to-be-sourced shell scripts in 't/ax' automatically, both in in-tree
and  VPATH builds.

With this change, we take another step forward a more rational and
"segregated" organization of our testsuite framework.

* defs-static.in: Rename ...
* t/ax/test-defs.in: ... like this, and adjust.
* Makefile.am, syntax-checks.mk, t/README, gen-testsuite-part,
t/tests-init.sh, t/ax/tap-setup.sh, t/tap-summary.sh, .gitignore,
t/testsuite-summary-color.sh, t/testsuite-summary-count.sh,
t/self-check-tap.sh, defs: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: update PATH early from AM_TESTS_ENVIRONMENT and runtest
Stefano Lattarini [Wed, 25 Jul 2012 21:06:06 +0000 (23:06 +0200)] 
tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest

Because the POSIX standards mandate that sourcing a file with ". FILE"
will cause FILE (assuming it is a relative containing no slashes) to be
looked for in PATH, such a move will allow us to simplify our sourcing
of shell testing libraries like (currently) 't/ax/test-init.sh' and
'defs', and to modularize and re-organize them better in the feature,
with minimal churn.

* runtest.in, Makefile.am (AM_TEST_ENVIRONMENT): Prepend $(abs_srcdir)/t/ax
and $(abs_builddir)/t/ax (in that order) to PATH; do so avoiding repetition
in the common case of non-VPATH builds.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: export $srcdir for use by the test scripts
Stefano Lattarini [Wed, 25 Jul 2012 11:30:05 +0000 (13:30 +0200)] 
runtest: export $srcdir for use by the test scripts

This is mostly a preparatory change in view of future ones.  But it
also make the behaviour of runtest more similar to that of the test
harness used by "make check".

* runtest.in: Export srcdir (was already defined to '@srcdir@').

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agogen-tests: $testdir/ax -> $testauxdir
Stefano Lattarini [Wed, 25 Jul 2012 20:06:12 +0000 (22:06 +0200)] 
gen-tests: $testdir/ax -> $testauxdir

* gen-testsuite-part ($testauxdir): New, defined to "$testdir/ax".
Use it throughout, for better encapsulation and less duplication.
($auxdir): Remove as unneeded.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agogen-tests: less hard-coding of 't' as the test directory
Stefano Lattarini [Wed, 25 Jul 2012 13:55:57 +0000 (15:55 +0200)] 
gen-tests: less hard-coding of 't' as the test directory

This will make life easier for us in case we decide to rename the
testsuite directory in the future (perhaps to something like 'tests',
which is somewhat less cryptic than the current 't').

* gen-testsuite-part ($testdir): New variable, used throughout instead
of hard-coding the name of the test directory to 't'.
All the script adjusted to make proper use of '$testdir'.
($auxdir): Move its definition earlier, for consistency with the one
of '$testdir'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agobuild: auxiliary testsuite files/scripts built by "make all"
Stefano Lattarini [Wed, 25 Jul 2012 14:31:17 +0000 (16:31 +0200)] 
build: auxiliary testsuite files/scripts built by "make all"

This will allow the developers to run a tests case by hand out of
a newly extracted tarball simply doing:

    $ ./configure && make
    $ ./runtest t/the-test-case.sh

while before this change one has to resort to:

    $ ./configure && make && make check TESTS=
    $ ./runtest t/the-test-case.sh

or, with some non-GNU makes, even:

    $ ./configure && make && make check TESTS= AM_MAKEFLAGS="TESTS="
    $ ./runtest t/the-test-case.sh

This come very handy sometimes, especially when doing one-shot
debugging.  Admittedly not a big deal, but one less friction in
the build system is always nice.

* Makefile.am (check_SCRIPTS, dist_check_DATA, nodist_check_DATA):
Move their content to ...
(noinst_SCRIPTS, dist_noinst_DATA, nodist_noinst_DATA): ... these
variables.
Adjust comments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoperf tests: reorganize
Stefano Lattarini [Wed, 25 Jul 2012 17:06:22 +0000 (19:06 +0200)] 
perf tests: reorganize

* t/list-of-tests.mk (handwritten_TESTS): Don't list ($perf_TESTS) in
here anymore.
* Makefile.am (EXTRA_DIST): Add them explicitly.
(perf): New target, run the performance tests and save the logs of
the ones with unexpected results in the file 't/perf/test-suite.log',
which is thus ...
(PERF_TEST_SUITE_LOG): ... defined in this variable ...
(CLEANFILES): ... and added to this.
(test_subdirs): Remove 't/perf': the tests in there are no more
listed in $(TESTS).
* t/ax/test-init.sh: Don't explicitly skip "perf" test here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: pass *all* the given shell options to the test invocation
Stefano Lattarini [Thu, 26 Jul 2012 09:41:51 +0000 (11:41 +0200)] 
runtest: pass *all* the given shell options to the test invocation

* runtest.in: Here.  This didn't work previously because, in our
option parsing loop, we were mistakenly redefining '$shell_opts'
each time, instead of appending to it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: correctly pass shell option also for TAP tests
Stefano Lattarini [Thu, 26 Jul 2012 09:40:53 +0000 (11:40 +0200)] 
runtest: correctly pass shell option also for TAP tests

* runtest.in: Here.  This required code refactoring not
completely trivial.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocosmetics: remove leftover comment fragment from runtest.in
Stefano Lattarini [Wed, 25 Jul 2012 17:11:40 +0000 (19:11 +0200)] 
cosmetics: remove leftover comment fragment from runtest.in

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest defs: improve a comment
Stefano Lattarini [Wed, 25 Jul 2012 11:16:59 +0000 (13:16 +0200)] 
test defs: improve a comment

* defs-static.in: Here, about the unsetting of CDPATH.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest defs: remove obsolete comment
Stefano Lattarini [Wed, 25 Jul 2012 11:14:48 +0000 (13:14 +0200)] 
test defs: remove obsolete comment

* defs-static.in: Here: do not state anymore that this file should execute
correctly with any system's /bin/sh shell, as this is not true anymore: the
testsuite assumes a POSIX shell throughout these days.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: support option --shell, tell which shell should run the test
Stefano Lattarini [Wed, 25 Jul 2012 11:03:17 +0000 (13:03 +0200)] 
runtest: support option --shell, tell which shell should run the test

* runtest.in: Here.  The same effect could have been obtained by
exporting AM_TEST_RUNNER_SHELL to the desired value, but the new
API is simpler and requires less typing and less thinking.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: support passing options over to the shell
Stefano Lattarini [Wed, 25 Jul 2012 10:56:43 +0000 (12:56 +0200)] 
runtest: support passing options over to the shell

* runtest.in: Here.  Also, support '--help' to display a nice
help screen.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: avoid spurious failure when running as root
Stefano Lattarini [Wed, 25 Jul 2012 10:40:10 +0000 (12:40 +0200)] 
tests: avoid spurious failure when running as root

Fixes automake bug#12041.

* t/primary-prefix-couples-force-valid.sh: If run as root, don't expect
a "test -x" on a non-executable files to fail: for root, all files are
executable (as well as readable and writable), and at least on Solaris
10 that causes "test -x" to succeed also on non-executable files.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix spurious failure in 'color-tests2.sh'
Stefano Lattarini [Tue, 24 Jul 2012 22:30:22 +0000 (00:30 +0200)] 
[ng] tests: fix spurious failure in 'color-tests2.sh'

* t/color-tests2.sh: Change the idioms used to specify the value of
'AM_COLOR_TESTS' to make.  This is required since, in contrast with
what happens in the mainline Automake counterpart, this script doesn't
invoke make with the '-e' option.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Tue, 24 Jul 2012 22:14:09 +0000 (00:14 +0200)] 
Merge branch 'master' into ng/master

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Tue, 24 Jul 2012 21:51:44 +0000 (23:51 +0200)] 
Merge branch 'maint'

* maint:
  tests: avoid non-textual output in a '.log' file

13 years agotests: avoid non-textual output in a '.log' file
Stefano Lattarini [Tue, 24 Jul 2012 20:56:01 +0000 (22:56 +0200)] 
tests: avoid non-textual output in a '.log' file

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags: refactor to reduce code duplication (2)
Stefano Lattarini [Tue, 24 Jul 2012 17:58:45 +0000 (19:58 +0200)] 
tags: refactor to reduce code duplication (2)

No semantic change is intended.

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags: refactor to reduce code duplication (1)
Stefano Lattarini [Tue, 24 Jul 2012 17:25:02 +0000 (19:25 +0200)] 
tags: refactor to reduce code duplication (1)

No semantic change is intended.

* lib/am/tags.am (am__uniquify_input): New variable, factor
out some code common to ...
(ctags-am, tags-am, ID): ... the recipes of these targets.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branches 'tags-simplify-recursion' and 'color-tests-always'
Stefano Lattarini [Tue, 24 Jul 2012 16:43:50 +0000 (18:43 +0200)] 
Merge branches 'tags-simplify-recursion' and 'color-tests-always'

* tags-simplify-recursion:
  tags: unify recursion for tags targets with that of "usual" targets

* color-tests-always:
  tests: better name for a couple of tests
  check: support colorized testsuite output by default

13 years ago[ng] rename: am__memoized_value/* -> am.memoize.value/*
Stefano Lattarini [Tue, 24 Jul 2012 14:38:22 +0000 (16:38 +0200)] 
[ng] rename: am__memoized_value/* -> am.memoize.value/*

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: move a variable definition
Stefano Lattarini [Tue, 24 Jul 2012 14:36:34 +0000 (16:36 +0200)] 
[ng] cosmetics: move a variable definition

* 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).

Reported by Akim Demaille.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: run two slow tests earlier, for better "make -j" performance
Stefano Lattarini [Tue, 24 Jul 2012 13:52:38 +0000 (15:52 +0200)] 
[ng] tests: run two slow tests earlier, for better "make -j" performance

* Makefile.am (long_running_TESTS): Add 't/parallel-tests-many.sh' and
't/dist-many.sh', which are slooow.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: names of iterating vars in $(foreach) loops shorter & simpler
Stefano Lattarini [Tue, 24 Jul 2012 13:23:08 +0000 (15:23 +0200)] 
[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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] spy: iteration variables in "$(foreach ...)" loops are temporary
Stefano Lattarini [Tue, 24 Jul 2012 13:05:14 +0000 (15:05 +0200)] 
[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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: .am.* -> am.*
Stefano Lattarini [Tue, 24 Jul 2012 12:34:58 +0000 (14:34 +0200)] 
[ng] rename: .am.* -> am.*

This is the complete list of renames done in this patch:

    .am.clean-cmd.f  ->  am.clean-cmd.f
    .am.clean-cmd.d  ->  am.clean-cmd.d
    .am.rm-f         ->  am.rm-f
    .am.rm-rf        ->  am.rm-rf

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__memoize -> am.memoize
Stefano Lattarini [Tue, 24 Jul 2012 10:00:02 +0000 (12:00 +0200)] 
[ng] rename: am__memoize -> am.memoize

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__newline -> am.chars.newline
Stefano Lattarini [Tue, 24 Jul 2012 09:58:33 +0000 (11:58 +0200)] 
[ng] rename: am__newline -> am.chars.newline

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: fix botches spaces in t/memoize.tap
Stefano Lattarini [Mon, 23 Jul 2012 18:12:17 +0000 (20:12 +0200)] 
[ng] cosmetics: fix botches spaces in t/memoize.tap

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix test driver botch-up on Solaris
Stefano Lattarini [Mon, 23 Jul 2012 14:57:00 +0000 (16:57 +0200)] 
[ng] tests: fix test driver botch-up on Solaris

This issue is very similar to the one fixed by commit v1.12.2-31-g587e0c6.

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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: relax even more a grepping check on configure output
Stefano Lattarini [Mon, 23 Jul 2012 18:09:08 +0000 (20:09 +0200)] 
[ng] tests: relax even more a grepping check on configure output

This is a follow-up to today's commit v1.12.2-594-geee3aff.

* t/subpkg.sh: Here: don't be too picky about the verb declension
used in a "checking whether" message.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Mon, 23 Jul 2012 14:27:22 +0000 (16:27 +0200)] 
Merge branch 'master' into ng/master

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: relax a grepping check on configure output
Stefano Lattarini [Mon, 23 Jul 2012 14:20:49 +0000 (16:20 +0200)] 
tests: relax a grepping check on configure output

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/many-tests' into ng/master
Stefano Lattarini [Mon, 23 Jul 2012 12:47:05 +0000 (14:47 +0200)] 
Merge branch 'ng/many-tests' into ng/master

* 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

13 years agotests: avoid a spurious failure with Solaris /bin/sh
Stefano Lattarini [Mon, 23 Jul 2012 11:35:28 +0000 (13:35 +0200)] 
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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: fix buglet in t/missing3.sh
Stefano Lattarini [Mon, 23 Jul 2012 11:15:13 +0000 (13:15 +0200)] 
tests: fix buglet in t/missing3.sh

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] news: remove duplicated header
Stefano Lattarini [Mon, 23 Jul 2012 10:28:16 +0000 (12:28 +0200)] 
[ng] news: remove duplicated header

* NG-NEWS (Obsolete Features Removed): This.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Mon, 23 Jul 2012 10:27:15 +0000 (12:27 +0200)] 
Merge branch 'maint'

* 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

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'fix-pr11909' into maint
Stefano Lattarini [Mon, 23 Jul 2012 08:51:48 +0000 (10:51 +0200)] 
Merge branch 'fix-pr11909' into maint

* fix-pr11909:
  self tests: avoid spurious failures on older bash

13 years agoself tests: avoid spurious failures on older bash
Stefano Lattarini [Sat, 14 Jul 2012 11:56:34 +0000 (13:56 +0200)] 
self tests: avoid spurious failures on older bash

Fixes automake bug#11909.

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: remove t/parallel-tests-many.sh (fixes spurious failure)
Stefano Lattarini [Mon, 23 Jul 2012 08:37:17 +0000 (10:37 +0200)] 
tests: remove t/parallel-tests-many.sh (fixes spurious failure)

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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: ACLOCAL_M4 -> am.remake.aclocal-m4
Stefano Lattarini [Sun, 22 Jul 2012 16:26:55 +0000 (18:26 +0200)] 
[ng] rename: ACLOCAL_M4 -> am.remake.aclocal-m4

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__configure_deps -> am.remake.configure-deps
Stefano Lattarini [Sun, 22 Jul 2012 16:14:48 +0000 (18:14 +0200)] 
[ng] rename: am__configure_deps -> am.remake.configure-deps

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__aclocal_m4_deps -> am.remake.aclocal-m4-deps
Stefano Lattarini [Sun, 22 Jul 2012 16:10:04 +0000 (18:10 +0200)] 
[ng] rename: am__aclocal_m4_deps -> am.remake.aclocal-m4-deps

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__config_aux_dir -> am.conf.aux-dir
Stefano Lattarini [Sun, 22 Jul 2012 15:59:13 +0000 (17:59 +0200)] 
[ng] rename: am__config_aux_dir -> am.conf.aux-dir

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: better name for a couple of tests
Stefano Lattarini [Sun, 22 Jul 2012 15:06:04 +0000 (17:06 +0200)] 
tests: better name for a couple of tests

* t/color.sh: Rename ...
* t/color-tests.sh: ... like this.
* t/color2.sh: Rename ...
* t/color-tests2.sh: ... like this.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocheck: support colorized testsuite output by default
Stefano Lattarini [Sun, 22 Jul 2012 14:38:47 +0000 (16:38 +0200)] 
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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] yacc, lex: avoid extra forks in non-VPATH builds
Stefano Lattarini [Sun, 22 Jul 2012 12:44:10 +0000 (14:44 +0200)] 
[ng] yacc, lex: avoid extra forks in non-VPATH builds

* lib/am/yacc.am, lib/am/lex.am: Use $(am__ensure_dir_exists) instead
of hand-rolled poor-man equivalent to ensure the directory of the
target exists.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__skiplex -> am.lex.maybe-skip
Stefano Lattarini [Sun, 22 Jul 2012 12:00:46 +0000 (14:00 +0200)] 
[ng] rename: am__skiplex -> am.lex.maybe-skip

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__skipyacc -> am.yacc.maybe-skip
Stefano Lattarini [Sun, 22 Jul 2012 11:57:25 +0000 (13:57 +0200)] 
[ng] rename: am__skipyacc -> am.yacc.maybe-skip

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__yacc_c2h -> am.yacc.c2h
Stefano Lattarini [Sun, 22 Jul 2012 11:55:09 +0000 (13:55 +0200)] 
[ng] rename: am__yacc_c2h -> am.yacc.c2h

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] fixup: remove an obsolete "FIXME" comment
Stefano Lattarini [Sun, 22 Jul 2012 11:43:39 +0000 (13:43 +0200)] 
[ng] fixup: remove an obsolete "FIXME" comment

* 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!

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] typofix: fixed typos in comments and README
Stefano Lattarini [Sun, 22 Jul 2012 11:34:29 +0000 (13:34 +0200)] 
[ng] typofix: fixed typos in comments and README

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: enhance spy tests on pattern rulesn
Stefano Lattarini [Sun, 22 Jul 2012 06:53:14 +0000 (08:53 +0200)] 
[ng] tests: enhance spy tests on pattern rulesn

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: in recipes, don't use pipe when redirection suffices
Stefano Lattarini [Sun, 22 Jul 2012 09:31:32 +0000 (11:31 +0200)] 
[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.

Co-authored-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] recheck: don't exceed command line limits, even with many failed tests
Stefano Lattarini [Sat, 21 Jul 2012 08:13:58 +0000 (10:13 +0200)] 
[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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: recheck with many failed tests
Stefano Lattarini [Fri, 20 Jul 2012 18:53:57 +0000 (20:53 +0200)] 
[ng] coverage: recheck with many failed tests

* 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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags: unify recursion for tags targets with that of "usual" targets
Stefano Lattarini [Sun, 22 Jul 2012 09:07:22 +0000 (11:07 +0200)] 
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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactor for less duplication and better performances
Stefano Lattarini [Fri, 20 Jul 2012 17:38:20 +0000 (19:38 +0200)] 
[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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: use awk rather than grep+xargs to count test results
Stefano Lattarini [Fri, 20 Jul 2012 14:37:50 +0000 (16:37 +0200)] 
[ng] check: use awk rather than grep+xargs to count test results

* lib/am/parallel-tests.am ($(TEST_SUITE_LOG)): Here, with the help
of ...
(am__count_test_results): ... this new internal variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] parallel-tests: do not exceed command line length limits
Stefano Lattarini [Fri, 20 Jul 2012 10:28:46 +0000 (12:28 +0200)] 
[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.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: testing with lots of test scripts
Stefano Lattarini [Thu, 19 Jul 2012 11:42:19 +0000 (13:42 +0200)] 
[ng] coverage: testing with lots of test scripts

See long-standing automake bug#7868.

* 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).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: fix a spurious failure
Stefano Lattarini [Sat, 21 Jul 2012 17:50:54 +0000 (19:50 +0200)] 
[ng] maintcheck: fix a spurious failure

* t/clean-many2.sh: Add redundant quoting to 'rm', to avoid triggering
a failure in the 'sc_rm_minus_f' maintainer check.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/renames' into ng/master
Stefano Lattarini [Sat, 21 Jul 2012 16:56:42 +0000 (18:56 +0200)] 
Merge branch 'ng/renames' into ng/master

* ng/renames: (33 commits)
  [ng] rename: am__relativize -> am.dist.relativize-path
  [ng] rename: am__canon -> am.util.canon
  [ng] rename: am__toupper -> am.util.toupper
  [ng] rename: am__tolower -> am.util.tolower
  [ng] rename: am__using_parallel_tests -> am.conf.using-parallel-tests
  [ng] rename: am__vpath_rewrite -> am.vpath.rewrite
  [ng] rename: am__handle_exeext -> am.conf.handle-exeext
  [ng] rename: am__private_suffix -> am.hack.private-suffix
  [ng] rename: am__strip_suffixes -> am.util.strip-suffixes
  [ng] am__strip_suffixes: use $0 for recursive invocations
  [ng] rename: am__uniq -> am.util.uniq
  [ng] am__uniq: use $0 for recursive invocations
  [ng] rename: am__strip_lastword -> am.util.strip-last-word
  [ng] rename: am__strip_firstword -> am.util.strip-first-word
  [ng] rename: am__make_dryrun -> am.make.dry-run
  [ng] rename: am__empty -> am.chars.empty
  [ng] cosmetics: fix an imprecise comment
  [ng] rename: am__squote -> am.chars.squote
  [ng] rename: am__dquote -> am.chars.dquote
  [ng] rename: am__bquote -> am.chars.bquote
  ...

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: inline '&handle_install'
Stefano Lattarini [Sat, 21 Jul 2012 13:52:07 +0000 (15:52 +0200)] 
[ng] automake: inline '&handle_install'

* automake.in (handle_install): Delete, inlined ...
(generate_makefile): ... in here, as it had become a
trivial one-liner.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: new function &almost_verbatim (small refactoring)
Stefano Lattarini [Sat, 21 Jul 2012 13:49:25 +0000 (15:49 +0200)] 
[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'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotypofix: in a comment in the automake script
Stefano Lattarini [Sat, 21 Jul 2012 13:47:46 +0000 (15:47 +0200)] 
typofix: in a comment in the automake script

* automake.in (process_file): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__relativize -> am.dist.relativize-path
Stefano Lattarini [Sat, 21 Jul 2012 12:43:14 +0000 (14:43 +0200)] 
[ng] rename: am__relativize -> am.dist.relativize-path

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>