platform/upstream/automake.git
12 years agoelisp: --batch implies -q, remove -q
Jack Kelly [Mon, 16 Jul 2012 00:31:27 +0000 (10:31 +1000)]
elisp: --batch implies -q, remove -q

According to the emacs manual[1], --batch implies -q, so there's no
need to pass -q when compiling elisp.

* lib/am/lisp.am: Remove -q from $(EMACS) call.

[1]: http://gnu.org/s/emacs/manual/html_node/emacs/Initial-Options.html

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: support elisp files in subdirectories properly
Stefano Lattarini [Sat, 14 Jul 2012 21:14:45 +0000 (23:14 +0200)]
elisp: support elisp files in subdirectories properly

For more reference, see:
<http://lists.gnu.org/archive/html/automake/2009-10/msg00013.html>
<http://thread.gmane.org/gmane.comp.sysutils.automake.bugs/4772>

* lib/am/lisp.am (.el.elc): If the file being byte-compiled is in
a subdirectory, add that (both as a subdirectory of the builddir
and the srcdir) to the emacs load path.  While we are at it (and
for consistency), drop quoting of $(srcdir) and $(builddir), since
those variables are ensured (by configure-time checks) not to
contain white space nor shell metacharacters.
* t/list-of-tests.mk (XFAIL_TESTS): Add 't/lisp-subdir.sh' and
't/lisp-subdir2.sh', since they now passes.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: simplify suffix rules using emacs '-L' option
Stefano Lattarini [Sat, 14 Jul 2012 20:46:20 +0000 (22:46 +0200)]
elisp: simplify suffix rules using emacs '-L' option

* lib/am/lisp.am (.el.elc): Use '-L dir' instead of calling '--eval' to
explicitly append to the 'load-path' variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: no need to "absolutize" $(srcdir) and $(builddir) ...
Stefano Lattarini [Sat, 14 Jul 2012 20:42:48 +0000 (22:42 +0200)]
elisp: no need to "absolutize" $(srcdir) and $(builddir) ...

* lib/am/lisp.am (.el.elc): ... here: we don't chdir around anyway,
nor move or copy around our source '.el' files.  Update comments,
and re-wrap them while we are at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: prefer $(builddir) files over $(srcdir) ones
Stefano Lattarini [Sat, 14 Jul 2012 20:33:40 +0000 (22:33 +0200)]
elisp: prefer $(builddir) files over $(srcdir) ones

* lib/am/lisp.am (.el.elc): Here.  This better respects VPATH spirit.
Adjust and extends comments.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 't/lisp-loadpath.sh', which
now passes.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite)
Jack Kelly [Sat, 14 Jul 2012 11:52:43 +0000 (21:52 +1000)]
elisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite)

Motivated by automake bug#11806.

Traditionally, automake byte-compiled emacs-lisp '.el' files by invoking
'elisp-comp' on all of them in a bulk; this involved complex timestamping
and file-locking logic.  It was also brittle in any slightly-unusual
setup, because 'elisp-comp' operated by copying all of the elisp files
to be compiled into a temporary sub-directory and compiling them in there,
the copying the resulting byte-compile files back in the build directory.

This patch removes all of that juggling and chicanery in favour of
defining a much simpler '.el.elc' suffix rule.  Not only this is simpler,
but it also interacts better with "make -jN" calls, which are becoming
more and more common and useful on today's increasingly multicore systems.

* Makefile.am (dist_script_DATA): Remove 'elisp-comp'.
* automake.in (@common_files): Likewise.
(handle_emacs_lisp): Do not require 'elisp-comp'.
* doc/automake.texi: Remove references to 'elisp-comp'.
* lib/am/lisp.am: Define elisp compilation via a suffix rule; this
basically amounts to a complete re-write of the lisp byte-compilation
rules.
* lib/elisp-comp: Remove.
* t/add-missing.tap: Remove elisp-comp test.
* t/dist-auxdir-many-subdirs.sh: Remove reference to elisp-comp.
* t/primary-prefix-invalid-couples.tap: Likewise.
* t/primary-prefix-valid-couples.sh: Likewise.
* t/lisp4.sh: Remove reference to elc-stamp.
* t/lisp5.sh: Likewise.
* t/lisp6.sh: Likewise.
* t/lisp3.sh: Likewise.  Also remove the recompilation check that
involves a (message) call.
* t/lisp7.sh: Remove check for "Warnings can be ignored".  Remove
reference to elc-stamp.
* t/lisp8.sh: Likewise.
* t/lispdry.sh: Remove references to elc-stamp.

Acked-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: elisp path contains $(srcdir) and $(builddir)
Stefano Lattarini [Sat, 14 Jul 2012 19:54:03 +0000 (21:54 +0200)]
coverage: elisp path contains $(srcdir) and $(builddir)

* t/lisp-loadpath.sh: Check that.  Also check that, in true VPATH
spirit, elisp files in the build directory are preferred to those
in the source directory.  This test currently fails.
* t/list-of-tests.mk (handwritten_TESTS): Add the new test.
(XFAIL_TESTS): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: emacs lisp files in subdirectories
Stefano Lattarini [Sat, 14 Jul 2012 18:55:30 +0000 (20:55 +0200)]
coverage: emacs lisp files in subdirectories

* t/lisp-subdir.sh, t/lisp-subdir2.sh: New tests, still failing.
* t/list-of-files.mk (handwritten_TESTS, XFAIL_TESTS): Add them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Fri, 13 Jul 2012 12:58:17 +0000 (14:58 +0200)]
Merge branch 'maint'

* maint:
  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

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: mention fixed testsuite weaknesses
Stefano Lattarini [Fri, 13 Jul 2012 12:47:54 +0000 (14:47 +0200)]
news: mention fixed testsuite weaknesses

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: bump, for future 1.12.3
Stefano Lattarini [Fri, 13 Jul 2012 12:43:36 +0000 (14:43 +0200)]
news: bump, for future 1.12.3

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branches 'fix-pr11898' and 'fix-pr-11893-and-10766' into maint
Stefano Lattarini [Fri, 13 Jul 2012 11:55:58 +0000 (13:55 +0200)]
Merge branches 'fix-pr11898' and 'fix-pr-11893-and-10766' into maint

* fix-pr11898:
  tests: verify the shell test scripts are syntactically valid

* fix-pr-11893-and-10766:
  tests: don't use C instead of C++ compiler on case-insensitive platforms

12 years agotests: verify the shell test scripts are syntactically valid
Stefano Lattarini [Wed, 11 Jul 2012 08:51:15 +0000 (10:51 +0200)]
tests: verify the shell test scripts are syntactically valid

Fixes automake bug#11898.

This measure of extra safety is mostly motivated by the fact that some
shells (at least some versions of Bash in the 3.x release series, one
of which serves as /bin/sh on Mac OS X 10.7, as well as Bash 4.0 and the
/usr/xpg4/bin/sh shell from Solaris 10) erroneously exit with exit status
0 upon encountering a syntax error, if an exit trap is sett (as it is in
our test scripts).

* Makefile.am (check-tests-syntax): New, check that the shell test
scripts listed in $(TESTS) are syntactically correct.
(.PHONY, check-local): Depend on it.
* t/self-check-exit.tap : Remove checks verifying that a script exits
with non-zero status upon encountering a syntax error; as explained
above, we can't depend on that.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: don't use C instead of C++ compiler on case-insensitive platforms
Stefano Lattarini [Wed, 11 Jul 2012 12:36:13 +0000 (14:36 +0200)]
tests: don't use C instead of C++ compiler on case-insensitive platforms

This change fixes automake bug#11893 and bug#10766.

On at least Cygwin and Mac OS X 10.7, the file system where the system
compilers are located can be case-insensitive, so that looking for a
program named 'CC' might actually find the C compiler in /usr/bin/cc.

Now, the Automake configure script looks for a C++ compiler named 'CC'
before looking for more obvious names like c++ or g++ (that is done to
increase testsuite "coverage in the wild", e.g., preferring, on Solaris,
the Sun Studio C++ compiler /usr/bin/CC over the GNU C++ compiler).

Since the checks done in AC_PROG_CXX are apparently not strict enough
to rule out C compilers like those from GCC or Clang (which are smart
enough to recognize if a file has a C++ extension, passing it to the
C++ front end) the testsuite might end up using a C compiler where a
C++ one is expected, with some subtle bad consequences.

* configure.ac: Don't look for a C++ compiler named 'CC' if the
"top-level" file system(s) (where /bin and /usr/bin are) are detected
to be case-insensitive.

Reported-by: Peter Rosin <peda@lysator.liu.se>
Reported-by: Max Horn <max@quendi.de>
Helped-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid spurious TAP errors on Mac OS X 10.7
Stefano Lattarini [Tue, 10 Jul 2012 13:29:57 +0000 (15:29 +0200)]
tests: avoid spurious TAP errors on Mac OS X 10.7

Fixes automake bug#1897.  Reported by Max Horn.

* t/suffix8.tap: The libtool bug#11895 was causing the ./configure script
to output a stray "ok" string on a line of its own, confusing the TAP
driver into thinking this was an extra test result (which resulted in the
next, real test results being flagged as "OUT-OF-ORDER").  Fix this by
protecting configure output.
* t/suffix10.tap: Likewise, and for the "make distcheck" output as well.
* THANKS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: fix spurious failure in aclocal7.sh on fast machines
Adam Sampson [Tue, 10 Jul 2012 13:08:15 +0000 (15:08 +0200)]
tests: fix spurious failure in aclocal7.sh on fast machines

Fixes automake bug#11896.  Issue introduced in commit v1.12.1-46-g13dd512.

* t/aclocal7.sh: Since aclocal rewrites aclocal.m4 unless the input files
are all older than the existing aclocal.m4, so we must sleep to ensure
somedefs.m4 has an older timestamp than the aclocal.m4 the next aclocal
call will generate.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint' (with fix for CVE-2012-3386)
Stefano Lattarini [Mon, 9 Jul 2012 17:33:03 +0000 (19:33 +0200)]
Merge branch 'maint' (with fix for CVE-2012-3386)

This makes the fix for a locally-exploitable security vulnerability
(CVE-2012-3386) available to the Automake master branch.

* maint:
  sync: update files from upstream with "make fetch"
  news: improve wording in entry about CVE-2012-3386
  maint: post-release minor version bump
  release: stable release 1.12.2
  distcheck: never make part of $(distdir) world-writable
  compat: automake should substitute @mkdir_p@, for backward compatibility
  fixup: t/README: it's ./runtest, not ./t/ax/runtest

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agosync: update files from upstream with "make fetch"
Stefano Lattarini [Mon, 9 Jul 2012 16:26:56 +0000 (18:26 +0200)]
sync: update files from upstream with "make fetch"

* lib/config.guess, lib/gitlog-to-changelog, lib/texinfo.tex: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: improve wording in entry about CVE-2012-3386
Stefano Lattarini [Mon, 9 Jul 2012 16:20:33 +0000 (18:20 +0200)]
news: improve wording in entry about CVE-2012-3386

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agomaint: post-release minor version bump
Stefano Lattarini [Mon, 9 Jul 2012 16:19:55 +0000 (18:19 +0200)]
maint: post-release minor version bump

* configure.ac (AC_INIT): Bump version number to 1.12.2a.
* m4/amversion.m4: Likewise (automatically regenerated by
"make bootstrap").

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agorelease: stable release 1.12.2 v1.12.2
Stefano Lattarini [Mon, 9 Jul 2012 15:26:14 +0000 (17:26 +0200)]
release: stable release 1.12.2

* configure.ac (AC_INIT): Bump version number to 1.12.2.
* m4/amversion.m4: Likewise (auto-updated by "./bootstrap").

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'distcheck-vulnerability-CVE-2012-3386' into maint
Stefano Lattarini [Mon, 9 Jul 2012 14:51:06 +0000 (16:51 +0200)]
Merge branch 'distcheck-vulnerability-CVE-2012-3386' into maint

* distcheck-vulnerability-CVE-2012-3386:
  distcheck: never make part of $(distdir) world-writable

12 years agodistcheck: never make part of $(distdir) world-writable
Stefano Lattarini [Fri, 6 Jul 2012 20:43:04 +0000 (22:43 +0200)]
distcheck: never make part of $(distdir) world-writable

This fixes a locally-exploitable security vulnerability (CVE-2012-3386).

In the 'distcheck' rule, we used to make the just-extracted (from
the distribution tarball) $(distdir) directory and all its files and
subdirectories read-only; then, in order to create the '_inst' and
'_build' subdirectories in there (used by the rest of the recipe) we
made the top-level $(distdir) *world-writable* for an instant (the
time to create those two directories) before making it read-only
again.

Making that directory world-writable (albeit only briefly) introduced a
locally exploitable race condition for those who run "make distcheck" with
a non-restrictive umask (e.g., 022) in a directory that is accessible by
others.  A successful exploit would result in arbitrary code execution
with the privileges of the user running "make distcheck" -- game over.
Jim Meyering wrote a proof-of-concept script showing that such exploit is
easily implemented.

This issue is similar to the CVE-2009-4029 vulnerability:
<http://lists.gnu.org/archive/html/automake/2009-12/msg00012.html>

* lib/am/distdir.am (distcheck): Don't make $(distdir) world-writable,
not even for an instant; make it user-writable instead, which is enough.

Helped-By: Jim Meyering <jim@meyering.net>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocompat: automake should substitute @mkdir_p@, for backward compatibility
Stefano Lattarini [Mon, 9 Jul 2012 08:33:49 +0000 (10:33 +0200)]
compat: automake should substitute @mkdir_p@, for backward compatibility

That has been unwittingly broken by commit v1.12-19-g7a1eb9f of 2012-04-28,
"AM_PROG_MKDIR_P: deprecate, to be removed in Automake 1.13". We thought it
wasn't a big deal, but Jim Meyering reported that @mkdir_p@ is used in
gettext's Makefile.in.in template:
<http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>

* lib/am/header-vars.am (mkdir_p): Don't define.
* m4/init.m4 (AM_INIT_AUTOMAKE): AC_SUBST 'mkdir_p' with $(MKDIR_P).
* t/mkdir_p.sh, t/mkdirp-deprecation.sh: Enhance.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agofixup: t/README: it's ./runtest, not ./t/ax/runtest
Stefano Lattarini [Sun, 8 Jul 2012 07:56:18 +0000 (09:56 +0200)]
fixup: t/README: it's ./runtest, not ./t/ax/runtest

* t/README (Supported shells): Here. And remove an extra empty line.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 7 Jul 2012 10:55:29 +0000 (12:55 +0200)]
Merge branch 'maint'

* maint:
  tests: move 'runtest' into the top-level directory

12 years agotests: move 'runtest' into the top-level directory
Stefano Lattarini [Sat, 7 Jul 2012 10:08:05 +0000 (12:08 +0200)]
tests: move 'runtest' into the top-level directory

Move our wrapper script 'runtest' (meant to allow the execution of
Automake test cases from the command line) from the 't/ax/' directory
to the top-level one.  This makes the script easier to find and to
invoke.  Much more importantly, our DejaGNU-checking test cases won't
try anymore to use that script instead of the 'runtest' program provided
by DejaGNU (that happened because '$(srcdir)/t/ax/' is automatically
added early to the $PATH variable in our test cases), which was causing
spurious SKIPs.

* t/ax/runtest.in: Move ...
* runtest.in: ... here.
* Makefile.am, t/README, .gitignore: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 7 Jul 2012 09:54:28 +0000 (11:54 +0200)]
Merge branch 'maint'

* maint:
  cosmetics: rename t/ax/test-runner => t/ax/runtest
  fixup: another "make recheck" failure with BSD make
  test runner: work correctly in VPATH setups
  compat: automake should define $(mkdir_p), for backward compatibility
  coverage: test that AM_PROG_MKDIR_P and $(mkdir_p) still works
  tests init: don't automatically re-execute tests with a POSIX shell
  yacc tests: fix spurious failure with parallel make
  tests: ignore minor 'recheck' regression for BSD make
  tests: don't clutter the top-level dir with temporary test directories
  tests: avoid spurious failures when @MKDIR_P@ points to "install-sh -d"
  lisp: better support of VPATH builds
  news: fixlets and updates

+ Extra non-trivial edits:

* NEWS: State that $(mkdir_p) is still provided as an alias to
$(MKDIR_P), for (partial) backward-compatibility.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocosmetics: rename t/ax/test-runner => t/ax/runtest
Stefano Lattarini [Fri, 6 Jul 2012 21:42:11 +0000 (23:42 +0200)]
cosmetics: rename t/ax/test-runner => t/ax/runtest

The latter is shorter and clearer.  Better to do the rename early,
before other developers or contributors begin to get used to the
'test-runner' name.

* t/ax/test-runner.in: Rename ...
* t/ax/runtest.in: ... like this.
* Makefile.am, t/README, .gitignore: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agofixup: another "make recheck" failure with BSD make
Stefano Lattarini [Fri, 6 Jul 2012 21:22:03 +0000 (23:22 +0200)]
fixup: another "make recheck" failure with BSD make

* t/parallel-tests-log-override-recheck.sh: Here, add a proper $sleep
before calling "make recheck".  This should ideally have been done
in the earlier commit 'v1.12.1-100-g19d84bc', but it somehow slipped
through the cracks.
* t/test-metadata-recheck.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotest runner: work correctly in VPATH setups
Stefano Lattarini [Fri, 6 Jul 2012 20:17:59 +0000 (22:17 +0200)]
test runner: work correctly in VPATH setups

Due to a "feature" of AC_CONFIG_FILES, because 't/ax/test-runner.in'
is in a subdirectory, the '@srcdir@' value that is AC_SUBST'd in it
gets tweaked to contain as much '..' components as are the directory
components of 't/ax/test-runner'.  Because our build system operates
in a non-recursive setup, this substitution is wrong; for example,
the final 't/ax/test-runner' build in a VPATH builds where the source
directory is ".." contains the line:

    : ${srcdir='../../../t/ax'}

instead of the expected (and correct):

    : ${srcdir='../t/ax'}

We solve the issue by building 't/ax/test-runner' with a Makefile
recipe instead of config.status substitutions; this is already done
for other testsuite-related files, like 'defs-static'.

* configure.ac (AC_CONFIG_FILES): Don't build 't/ax/test-runner'
anymore.
* Makefile.am (t/ax/test-runner): New rule.
(EXTRA_DIST): Add 't/ax/test-runner.in'.
(CLEANFILES, noinst_SCRIPTS): Add 't/ax/test-runner'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'fix-pr11806' into maint
Stefano Lattarini [Fri, 6 Jul 2012 19:29:52 +0000 (21:29 +0200)]
Merge branch 'fix-pr11806' into maint

* fix-pr11806:
  lisp: better support of VPATH builds

12 years agotests init: don't automatically re-execute tests with a POSIX shell
Stefano Lattarini [Fri, 6 Jul 2012 10:24:33 +0000 (12:24 +0200)]
tests init: don't automatically re-execute tests with a POSIX shell

I've unwittingly broken support for that feature *again* in some of
my recent testsuite tweaking.  In this case, the re-execution code
works correctly when the tests are executed with a POSIX shells, but
breaks when they are invoked by an old-style Bourne shells (e.g.,
/bin/sh on Solaris).

It's time to face it: that feature is too much brittle, and too seldom
used (because the Makefile takes care of running the tests with the
correct shell anyway, so that a breakage is only experienced when
running the tests by hand).  It just don't remain working for long, not
when we often touch the testsuite setup (which we are going to do again
when we'll try to move part of our testsuite framework to Gnulib, or a
similar project).

So, instead of trying to be extra-smart and automatically re-execute the
tests with the correct shell, we now offer a simple wrapper script that
the user can employ to run the test scripts with the proper shell.  And
while we are at it, we write this wrapper to also deal with TAP tests in
a better way, running them through the prove(1) utility, so that their
results are correctly recognized and reported.

* t/ax/test-runner.in: New file; the wrapper script we were talking about.
* configure.ac (AC_CONFIG_FILES): Process it into 't/ax/test-runner'.
* .gitignore: Add 't/ax/test-runner'.
* defs: Remove code for automatic re-execution of the scripts with the
correct shell.  This file now just a very thin layer around 'defs-static'
and 't/ax/test-init.sh'.
* t/README: Adjust, and remove or fix some imprecise or outdated text in
the process (like "... test scripts are written with portability in mind,
so that they should run with any decent Bourne-compatible shell ..." ).
* Makefile.am (AM_TESTS_ENVIRONMENT): No need to export 'AM_TESTS_REEXEC'
to "no" anymore.
* t/self-check-explicit-skips.sh: Likewise.
* t/self-check-exit.tap: Likewise.
* t/self-check-me.tap: Likewise.
* t/self-check-dir.tap: Likewise.
* t/self-check-reexec.tap: Remove as obsolete.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoyacc tests: fix spurious failure with parallel make
Stefano Lattarini [Fri, 6 Jul 2012 19:15:37 +0000 (21:15 +0200)]
yacc tests: fix spurious failure with parallel make

* t/yacc-deleted-headers.sh: Here, by adding a missing dependency
in the Makefile.am.  Revealed by a failure with Sun Distributed make
run on Solaris 10 in parallel mode.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: ignore minor 'recheck' regression for BSD make
Stefano Lattarini [Fri, 6 Jul 2012 12:35:04 +0000 (14:35 +0200)]
tests: ignore minor 'recheck' regression for BSD make

It turns out that, with NetBSD 5.1 make and FreeBSD 9 make, running
"make recheck" two times in a row quickly fails to correctly re-run
the failed tests in the second run.

That issue has been introduced likely introduced in commit
'v1.12.1-95-gd5443e4' of 20102-07-01, "parallel-tests: reimplement
fix for bug#11791".

Anyway, the use case that has been broken is not realistic (who is
going to run "make recheck" two times in one second, without modifying
any of the tests or the tested programs in the meantime?), so we believe
the best fix is to simply work around the issue in the affected test
cases, rather than risking to slow down or uglify the 'recheck' rule.

* t/parallel-tests9.sh: Enhance a little.
* t/tap-recheck.sh: Adjust adding proper '$sleep' calls were required.
* t/parallel-tests-log-override-recheck.sh: Likewise.
* t/test-driver-custom-multitest-recheck.sh: Likewise.
* t/test-driver-custom-multitest-recheck2.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: don't clutter the top-level dir with temporary test directories
Stefano Lattarini [Fri, 6 Jul 2012 18:49:15 +0000 (20:49 +0200)]
tests: don't clutter the top-level dir with temporary test directories

* t/self-check-me.tap: Be sure to initialize '$am_create_testdir' to "no"
in all the shell invocations sourcing './defs'.  Otherwise, when running
the testsuite with 'keep_testdirs=yes', the following temporary director
are left cluttering the top-level directory:

  ./012.dir
  ./abc..dir
  ./a.b.c.dir
  ./foo.dir
  ./foo.bar.dir
  ./foo-bar-.dir
  ./_foo__bar.dir

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid spurious failures when @MKDIR_P@ points to "install-sh -d"
Stefano Lattarini [Fri, 6 Jul 2012 13:16:12 +0000 (15:16 +0200)]
tests: avoid spurious failures when @MKDIR_P@ points to "install-sh -d"

* t/self-check-cleanup.tap: Several checks in this test were failing on
NetBSD 5.1.  That happened because on that system, '@MKDIR_P@' expands to
an "install-sh -d" invocation that references the $(builddir), and the
code trying to duplicate some of the Automake testsuite infrastructure
in the test subdirectory of this self test wasn't smart enough to cater
to that situation.  Granted, we could tweak the test case once more to
fix this Yet Another Spurious Failure, but at this point it has become
clear that the extra coverage offered by this test is not worth all the
hassle.  Just remove the test.  Since the testsuite is regularly run on
several systems and with different setups, most issues with the testsuite
framework will reveal themselves anyway; no actual need to unit-test them
in our testsuite, if that's too tricky.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocompat: automake should define $(mkdir_p), for backward compatibility
Stefano Lattarini [Fri, 6 Jul 2012 08:12:30 +0000 (10:12 +0200)]
compat: automake should define $(mkdir_p), for backward compatibility

That has been unwittingly broken by commit 'v1.12-19-g7a1eb9f'
of 2012-04-28, "AM_PROG_MKDIR_P: deprecate, to be removed in
Automake 1.13".

Report from Benoit Sigoure and Diego Elio Pattenò:
<http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>

* lib/am/header-vars.am (mkdir_p): Define as an alias for $(MKDIR_P).
* t/list-of-tests.mk (XFAIL_TESTS): Remove 't/mkdir_p.sh'.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: test that AM_PROG_MKDIR_P and $(mkdir_p) still works
Stefano Lattarini [Fri, 6 Jul 2012 07:59:23 +0000 (09:59 +0200)]
coverage: test that AM_PROG_MKDIR_P and $(mkdir_p) still works

They are deprecated, but should continue to work in the 1.12.x
release series.  Report from Benoit Sigoure and Diego Elio Pattenò:
<http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>

* t/mkdirp-deprecation.sh: Enhance.
* t/mkdir_p.sh: New test, check that AM_INIT_AUTOMAKE still defines
the $(mkdir_p) make variable.  Currently xfailing.
* t/list-of-tests.mk (handwritten_TESTS, XFAIL_TESTS): Add the new
test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agolisp: better support of VPATH builds
Jack Kelly [Thu, 5 Jul 2012 16:50:37 +0000 (18:50 +0200)]
lisp: better support of VPATH builds

Fixes automake bug#11806.

* lib/am/lisp.am: Pass the value of '$(abs_srcdir)' to the
elisp-compile script in the environment.
* lib/elisp-comp: Add the vale of '$abs_srcdir' to the emacs
load-path.
* t/lisp-pr11806.sh: New test.
* t/list-of-tests.mk: Add it.

Copyright-paperwork-exempt: yes
Co-authored-by: Stefano Lattarini <stefano.lattarini@gnu.org>
Reported-by: Makoto Fujiwara <makoto@ki.nu>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: make 't/aclocal-macrodir.tap' executable
Stefano Lattarini [Tue, 3 Jul 2012 21:48:47 +0000 (23:48 +0200)]
tests: make 't/aclocal-macrodir.tap' executable

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agomaintcheck: fix spurious failure in 'maintainer-check-list-of-tests'
Stefano Lattarini [Tue, 3 Jul 2012 21:22:46 +0000 (23:22 +0200)]
maintcheck: fix spurious failure in 'maintainer-check-list-of-tests'

* Makefile.am (test_subdirs): Add 'contrib/t', otherwise we would get a
spurious error like:

  List of tests in Makefile an on filesystem differ
  + diff -u in-makefile on-filesystem
  --- tests-in-makefile-list.tmp    2012-07-03 23:07:47.000000000 +0200
  +++ tests-on-filesystem-list.tmp  2012-07-03 23:07:47.000000000 +0200
  @@ -1,7 +1,3 @@
  -contrib/t/help-multilib.sh
  -contrib/t/multilib.sh
  -contrib/t/parallel-tests-html-recursive.sh
  -contrib/t/parallel-tests-html.sh
   t/ac-output-old.tap
   t/acloca10.sh
   t/acloca11.sh
  make: *** [maintainer-check-list-of-tests] Error 1

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: fix cleaning of test directories in contrib (and in t/perf)
Stefano Lattarini [Tue, 3 Jul 2012 19:56:08 +0000 (21:56 +0200)]
build: fix cleaning of test directories in contrib (and in t/perf)

* Makefile.am (clean-local-check): Update recipe to cater to the fact
that some tests using a temporary directory have been placed in other
directories that the 't/' directory (for the moment, at least 't/perf'
and 'contrib/t').

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'aclocal-trace-macrodir'
Stefano Lattarini [Tue, 3 Jul 2012 19:15:33 +0000 (21:15 +0200)]
Merge branch 'aclocal-trace-macrodir'

* aclocal-trace-macrodir:
  aclocal: deprecate ACLOCAL_AMFLAGS, trace AC_CONFIG_MACRO_DIR instead

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoaclocal: deprecate ACLOCAL_AMFLAGS, trace AC_CONFIG_MACRO_DIR instead
Stefano Lattarini [Tue, 5 Oct 2010 15:14:00 +0000 (17:14 +0200)]
aclocal: deprecate ACLOCAL_AMFLAGS, trace AC_CONFIG_MACRO_DIR instead

Maintaining ACLOCAL_AMFLAGS in the Makefile.am to pass extra flags
to aclocal is (and have always been) quite of an hack.  For example,
autoreconf is forced to grep Makefile.am to honour those flags.  But
this is a bad obsolescent behaviour; in fact, the autotools have moved
consistently in the past years from custom grepping of Makefile.am and
configure.ac to tracing of m4 macro calls, which is more consistent,
more reliable and more flexible.

And when autoreconf is not used, the developer is forced to add *by hand*
the flags specified by ACLOCAL_AMFLAGS to the aclocal calls not triggered
by make rebuild rules; here lie again more duplication and more chances
for errors.

Moreover, ACLOCAL_AMFLAGS has only two typical use cases:

  - to instruct aclocal to look for extra macro definition in a local
    directory (as with "ACLOCAL_AMFLAGS = -I m4"); and

  - to further instruct aclocal to copy in that local directory the
    required third-party .m4 files found in the system-wide directory
    (as with "ACLOCAL_AMFLAGS = -I m4 --install").

The first use case can be better covered if aclocal can instead trace and
honours call to the AC_CONFIG_MACRO_DIR autoconf macro; and the second
use case shouldn't be considered really legitimate, as it is quite (and
subtly) brittle (see automake bug#9037).

Thus we now make aclocal trace AC_CONFIG_MACRO_DIR macro, and act
accordingly.  For backward compatibility, we continue to support the
ACLOCAL_AMFLAGS special variable (although removing any mention of it
from the documentation).  Future Automake releases will likely start
to warn about the use of that variable, and eventually remove support
for it altogether.

From a suggestion by Eric Blake.

This is a much simplified (and IMHO saner) version of the patch series
discussed in the threads:
<http://lists.gnu.org/archive/html/automake-patches/2010-10/msg00045.html>
<http://lists.gnu.org/archive/html/automake-patches/2010-12/msg00156.html>

* aclocal.in ($ac_config_macro_dir): New global variable.
(trace_used_macros): Also trace the macro 'AC_CONFIG_MACRO_DIR',
and set the '$ac_config_macro_dir' variable accordingly.
(parse_arguments): Code for diagnosis of '--install' used without
any user-specified include directory moved  ...
(while (1)): .. into the main loop.  Which now also updates the
list of user-specified include directories to include the directory
given as argument to the call (if any) of 'AC_CONFIG_MACRO_DIR'.
* lib/am/configure.am: Update comments.
* NEWS: Updated.
* doc/automake.texi: Likewise.  Also, stop advising the use of the
'--install' in ACLOCAL_AMFLAGS (see automake bug#9037 for a rationale),
and remove any reference to ACLOCAL_AMFLAGS (which is now considered
obsolescent).
* t/aclocal-path-install.sh: Adjust grepping check in the aclocal
error messages.
* t/subpkg.sh: Updated: add 'AC_CONFIG_MACRO_DIR' call to configure.ac,
remove setting of 'ACLOCAL_AMFLAGS' in Makefile.am and use of aclocal
command line arguments.
* t/subpkg2.sh: Likewise.
* t/subdir8.sh: Likewise.
* t/remake10c.sh: Likewise.
* t/remake8a.sh: Likewise.
* t/remake8b.sh: Likewise.
* t/aclocal4.sh: Likewise.
* t/aclocal6.sh: Likewise.
* t/acloca14.sh: Likewise.
* t/acloca22.sh: Likewise.
* t/aclocal5.sh: Likewise, and do not not invade the Automake
namespace (this avoids spurious failures).
* t/acloca14b.sh: New test, identical to the previous version of
'acloca14.test'; it is kept to verify backwards compatibility with
the use of ACLOCAL_AMFLAGS.
* t/acloca22b.sh: Likewise (but for 'acloca22.test').
* t/aclocal-amflags.sh: New test, check for backwards
compatibility that ACLOCAL_AMFLAGS still works.
* t/remake-macrodir.sh: New test, checking that aclocal's honoring of
AC_CONFIG_MACRO_DIR interacts nicely with automatic rebuild rules.
* t/list-of-tests.mk: Add the new tests.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: fixlets and updates
Stefano Lattarini [Tue, 3 Jul 2012 08:43:31 +0000 (10:43 +0200)]
news: fixlets and updates

* NEWS: Here.  In particular, report the change in 'missing'
semantics.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocontrib: check-html: pass flags to rst2html invocations
Stefano Lattarini [Mon, 2 Jul 2012 19:05:34 +0000 (21:05 +0200)]
contrib: check-html: pass flags to rst2html invocations

Related to automake bug#11287.

* contrib/t/check-html.am (.log.html): Here, passing $(AM_RST2HTMLFLAGS)
and $(RST2HTMLFLAGS) (in that order).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocontrib: simple improvements to check-html
Stefano Lattarini [Mon, 2 Jul 2012 18:58:23 +0000 (20:58 +0200)]
contrib: simple improvements to check-html

Related to automake bug#11287.

* contrib/t/check-html.am (.log.html): Do not look for $RST2HTML in
the environment, looking for $(RST2HTML) should be enough (also, the
pre-existing code was broken, because it single-quoted $RST2HTML).
Fix the loop-and-search implementation to be more similar to the
one in 'contrib/t/parallel-tests-html.sh'.  Prefer 'mv -f' over bare
'mv'.  Do not break the recipe in

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: check-html can be used recursively
Stefano Lattarini [Mon, 2 Jul 2012 18:33:03 +0000 (20:33 +0200)]
coverage: check-html can be used recursively

Addresses the main part of Automake bug#11287.

* contrib/t/parallel-tests-html-recursive.sh: New test.
* contrib/t/local.am: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: tests for stuff in contrib goes in 'contrib/t'
Stefano Lattarini [Mon, 2 Jul 2012 15:24:24 +0000 (17:24 +0200)]
tests: tests for stuff in contrib goes in 'contrib/t'

* t/help-multilib.sh: Move ...
* contrib/t/help-multilib.sh: .. here. Remove a now-obsolete
"FIXME" comment.
* t/multlib.sh: Move ...
* contrib/t/multilib.sh: .. here.  Remove a now-obsolete
"FIXME" comment.
* t/parallel-test2.sh: Move ...
* contrib/t/parallel-tests-html.sh: .. here.  Remove a
now-obsolete "FIXME" comment.
* contrib/t/local.am: New, basically defining the list of
tests for stuff in 'contrib/'.
* t/list-of-tests.mk, Makefile.am: Adjust.
* .gitignore: Update.
* syntax-checks.mk (xtests): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'user-recursive-targets'
Stefano Lattarini [Mon, 2 Jul 2012 13:04:12 +0000 (15:04 +0200)]
Merge branch 'user-recursive-targets'

* user-recursive-targets:
  recursion: support user-defined recursive targets
  tests: rename 'recurs*.sh' to 'var-recurs*.sh'
  tests: minor improvements to 'recurs*.sh'

12 years agorecursion: support user-defined recursive targets
Stefano Lattarini [Tue, 12 Jun 2012 12:48:12 +0000 (14:48 +0200)]
recursion: support user-defined recursive targets

The user can now define his own recursive targets that recurse
in the directories specified in $(SUBDIRS).  That can be done by
specifying the name of such targets in invocations of the new
'AM_EXTRA_RECURSIVE_TARGETS' m4 macro.

The API goes like this:

    $ cat configure.ac
    AC_INIT([pkg-name], [1.0]
    AM_INIT_AUTOMAKE
    AM_EXTRA_RECURSIVE_TARGETS([foo])
    AC_CONFIG_FILES([Makefile sub/Makefile])
    AC_OUTPUT

    $ cat Makefile.am
    SUBDIRS = sub
    foo-local:
        @echo This will be run by "make foo".

    $ cat sub/Makefile.am
    foo-local:
        @echo This too will be run by a "make foo" issued either in
        @echo the 'sub/' directory or in the top-level directory.

Like for the "default" recursive targets (e.g., 'all' and 'check'),
the user-defined recursive targets descend in the $(SUBDIRS) in a
depth-first fashion, and process '.' last (unless that is explicitly
specified in $(SUBDIRS)).

* NEWS, doc/automake.texi: Document the new feature.
* automake.in (@extra_recursive_targets): New global variable.
(scan_autoconf_traces): Trace macro '_AM_EXTRA_RECURSIVE_TARGETS'.
(handle_user_recursion): New subroutine; among other things, it defines
the new internal '$(am__extra_recursive_targets)' make variable, and
the '*-am', '*-local' and '*-recursive' targets associated with the
user-specified user recursive targets.
(generate_makefile): Call the new subroutine.
* lib/am/subdirs.am (am__recursive_targets): New internal make variable,
listing all of '$(RECURSIVE_TARGETS)', '$(RECURSIVE_CLEAN_TARGETS)' and
'$(am__extra_recursive_targets)' together.
(AM_RECURSIVE_TARGETS): Adjust the definition of this variable ...
(.PHONY, .MAKE): ... and the list of dependencies of these special targets
to take advantage of the new '$(am__recursive_targets)' variable.
($(am__recursive_targets)): New targets, superseding ...
($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)): ... these, and
inheriting their rules.  This way, the rules to handle recursion for
built-in recursive targets (e.g., 'all', 'dvi', 'clean') and for user
defined recursive targets are the same.
* m4/extra-recurs.m4: New file, contain definition of new macro
'AM_EXTRA_RECURSIVE_TARGETS' and '_AM_EXTRA_RECURSIVE_TARGETS'.
These macros are basically dummy, only used for tracing by automake.
* m4/Makefile.am (dist_automake_ac_DATA): Update.
* t/recurs-user.sh: New test.
* t/recurs-user2.sh: Likewise.
* t/recurs-user-deeply-nested.sh: Likewise.
* t/recurs-user-indir.sh: Likewise.
* t/recurs-user-keep-going.sh: Likewise.
* t/recurs-user-many.sh: Likewise.
* t/recurs-user-no-subdirs.sh: Likewise.
* t/recurs-user-no-top-level.sh: Likewise.
* t/recurs-user-override.sh: Likewise.
* t/recurs-user-phony.sh: Likewise.
* t/recurs-user-wrap.sh: Likewise.
* t/remake-recurs-user.sh: Likewise.
* t/list-of-tests.mk: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: rename 'recurs*.sh' to 'var-recurs*.sh'
Stefano Lattarini [Tue, 12 Jun 2012 08:11:35 +0000 (10:11 +0200)]
tests: rename 'recurs*.sh' to 'var-recurs*.sh'

* t/recurs.sh: Rename ...
* t/var-recurs.sh: ...  to this.
* t/recurs2.sh: Rename ...
* t/var-recurs2.sh: ... to this.
* tests/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: minor improvements to 'recurs*.sh'
Stefano Lattarini [Tue, 5 Oct 2010 20:19:46 +0000 (22:19 +0200)]
tests: minor improvements to 'recurs*.sh'

* t/recurs.sh: Removed useless calls to AM_CONDITIONAL in
the generated 'configure.ac'.
* t/recurs2.sh: Add trailing ':' command.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 1 Jul 2012 16:01:35 +0000 (18:01 +0200)]
Merge branch 'maint'

* maint:
  tests: don't trust the exit status of "make -k" for non-GNU makes
  parallel-tests: reimplement fix for bug#11791
  tests setup: unset CDPATH
  tests setup: more namespace safeness
  tests setup: remove an unused variable
  tests setup: less hard-coding of the test subdirectory

12 years agotests: don't trust the exit status of "make -k" for non-GNU makes
Stefano Lattarini [Sun, 1 Jul 2012 11:31:54 +0000 (13:31 +0200)]
tests: don't trust the exit status of "make -k" for non-GNU makes

* t/parallel-tests-recheck-pr11791.sh: Here.  At least some versions
of FreeBSD make botch it up, returning success when failure should be
returned.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoparallel-tests: reimplement fix for bug#11791
Stefano Lattarini [Sun, 1 Jul 2012 10:56:22 +0000 (12:56 +0200)]
parallel-tests: reimplement fix for bug#11791

* lib/am/check.am: Here.  The new implementation is shorter, slightly
more efficient (requiring less forks), less brittle in the face of
signals or unexpected interruptions in the make process, and should
also be easier to merge in the 'ng/master' branch (as of now, due to
the difficulties in merging our previous version of the fix in the
'ng/master' codebase, Automake-NG still lacks a fix for bug#11791).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests setup: unset CDPATH
Stefano Lattarini [Sun, 1 Jul 2012 09:50:54 +0000 (11:50 +0200)]
tests setup: unset CDPATH

So that our test scripts can safely chdir around using relative
paths as well, without having to worry abut possible CDPATH
interferences.

* defs-static.in: unset CDPATH.
* t/ax/tests-init.sh: Remove a now-unneeded workaround.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests setup: more namespace safeness
Stefano Lattarini [Sun, 1 Jul 2012 09:01:02 +0000 (11:01 +0200)]
tests setup: more namespace safeness

* t/ax/tests-init.sh ($testSubDir): Rename ...
($am_test_subdir): ... to this, throughout the file.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests setup: remove an unused variable
Stefano Lattarini [Sun, 1 Jul 2012 08:54:26 +0000 (10:54 +0200)]
tests setup: remove an unused variable

* defs-static.in ($testprefix): This one.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests setup: less hard-coding of the test subdirectory
Stefano Lattarini [Sun, 1 Jul 2012 08:36:34 +0000 (10:36 +0200)]
tests setup: less hard-coding of the test subdirectory

* t/ax/tests-init.sh: Make the code creating the temporary
test subdirectory smart enough to automatically create it
in the same subdirectory of the test that is being run.
* defs-static.in ($MKDIR_P, $am_rel_srcdir): New variables,
AC_SUBST'd from @MKDIR_P@ and @srcdir@ respectively, and
used in the new 'tests-init.sh' code.

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

* maint:
  parallel-tests: silence an overly verbose recipe
  tests: fix some uses of 'Exit', where 'exit' should now be used instead
  maintcheck: test scripts should be executable, check for that

12 years agoparallel-tests: silence an overly verbose recipe
Stefano Lattarini [Sat, 30 Jun 2012 21:37:57 +0000 (23:37 +0200)]
parallel-tests: silence an overly verbose recipe

*  lib/am/check.am (check-TESTS): Here, the part of the recipe
removing the stale '.log' and '.trs' files.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: fix some uses of 'Exit', where 'exit' should now be used instead
Stefano Lattarini [Sat, 30 Jun 2012 21:34:56 +0000 (23:34 +0200)]
tests: fix some uses of 'Exit', where 'exit' should now be used instead

* t/parallel-tests-recheck-pr11791.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agomaintcheck: test scripts should be executable, check for that
Stefano Lattarini [Sat, 30 Jun 2012 21:26:17 +0000 (23:26 +0200)]
maintcheck: test scripts should be executable, check for that

* syntax-checks.mk (sc_tests_executable): Here, in this new check.
(syntax_check_rules): Add it.
* Makefile.am (dist-hook): Drop, no need to make test cases executable
anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 30 Jun 2012 20:17:22 +0000 (22:17 +0200)]
Merge branch 'maint'

* maint:
  parallel-tests: recipes for "check" and "recheck" are separated again

12 years agoMerge branch 'recheck-fix' into maint
Stefano Lattarini [Sat, 30 Jun 2012 19:59:56 +0000 (21:59 +0200)]
Merge branch 'recheck-fix' into maint

* recheck-fix:
  parallel-tests: recipes for "check" and "recheck" are separated again

12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 30 Jun 2012 19:32:20 +0000 (21:32 +0200)]
Merge branch 'maint'

* maint:
  parallel-tests: "recheck" behaves better in case of compilation failures
  scripts: quote 'like this', not `like this'

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoparallel-tests: recipes for "check" and "recheck" are separated again
Stefano Lattarini [Sat, 30 Jun 2012 18:53:39 +0000 (20:53 +0200)]
parallel-tests: recipes for "check" and "recheck" are separated again

* lib/am/check.am: Here.  They have distinctly diverged recently, and
the reduction in code duplication obtained keeping their recipes united
is not anymore worth the extra complications.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'recheck-fix' into maint
Stefano Lattarini [Sat, 30 Jun 2012 18:20:22 +0000 (20:20 +0200)]
Merge branch 'recheck-fix' into maint

* recheck-fix:
  parallel-tests: "recheck" behaves better in case of compilation failures
  scripts: quote 'like this', not `like this'

12 years agotests: prefer "test ! -e FILE" to check that a file doesn't exist
Stefano Lattarini [Sat, 30 Jun 2012 17:46:13 +0000 (19:46 +0200)]
tests: prefer "test ! -e FILE" to check that a file doesn't exist

* t/autohdrdry.sh: Here, rather than using "test ! -r FILE".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotexi: clean after Texinfo manuals in $(SUBDIRS) directories correctly
Jim Meyering [Sat, 30 Jun 2012 11:53:37 +0000 (13:53 +0200)]
texi: clean after Texinfo manuals in $(SUBDIRS) directories correctly

Fixes the regression exposed by previous commit 'v1.12.1-165-g498492f'.

* automake.in (handle_texinfo_helper): Add $infobase.{t2d,t2p}
to @mostly_cleans, but *without* the '$relative_dir/' prefix.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: regression in texinfo "make mostlyclean" with $(SUBDIRS)
Stefano Lattarini [Sat, 30 Jun 2012 14:37:06 +0000 (16:37 +0200)]
coverage: regression in texinfo "make mostlyclean" with $(SUBDIRS)

After commit v1.12.1-91-g205c757 of 2012-06-20, "texi: require
Texinfo >= 4.9, related enhancements", the presence of a Texinfo manual
'manual.texi' in a subdir (say 'doc/') of a package using a recursive
make setup would cause "make distcheck" to fail, due to the presence of
the 'manual.t2d/' directory created by texi2dvi.  That directory would
not be correctly removed because the 'mostlyclean' rule would run, from
within the 'doc/' sub-directory, "rm -rf doc/manual.t2d", instead of
the expected (and correct) "rm -rf manual.t2d".

Reported by Jim Meyering:
<http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00203.html>

* t/txinfo21.sh: Enhance to expose the issue.
* t/txinfo-no-clutter.sh: Likewise, and other miscellaneous improvements.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 30 Jun 2012 11:42:10 +0000 (13:42 +0200)]
Merge branch 'maint'

* maint:
  tests: fix a spurious failure
  configure: fix detection of POSIX shell to work in a VPATH build
  tests: prefer "test ! -e FILE" to check that a file doesn't exist

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: fix a spurious failure
Stefano Lattarini [Sat, 30 Jun 2012 10:12:43 +0000 (12:12 +0200)]
tests: fix a spurious failure

* t/parallel-tests-dry-run-2.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoconfigure: fix detection of POSIX shell to work in a VPATH build
Stefano Lattarini [Sat, 30 Jun 2012 09:28:24 +0000 (11:28 +0200)]
configure: fix detection of POSIX shell to work in a VPATH build

* configure.ac: When checking whether "test -e" works, use 'config.log',
not 'configure', as the witness file, because the latter does not exist
in the current directory during a VPATH build.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: prefer "test ! -e FILE" to check that a file doesn't exist
Stefano Lattarini [Thu, 28 Jun 2012 22:48:11 +0000 (00:48 +0200)]
tests: prefer "test ! -e FILE" to check that a file doesn't exist

Once, for the sake of (at least) Solaris 10 /bin/sh, we had to use
"test ! -f FILE" or "test ! -r FILE" or "test ! -d FILE" instead,
because the that shell's 'test' built-in didn't grok the '-e' option.

Note however that we still can't use "test ! -e" in the Makefile recipes
used in the test cases; that is because those recipes are run with the
shell detected by 'configure', and Autoconf-generated configure scripts
do no guarantee to find or provide a POSIX-compatible shell.

* Several tests: Adjust.
* t/yacc-clean-cxx: Adjust, and remove a couple of useless commands.
* t/parallel-tests-dry-run-2.sh: Adjust, and add invocation to
"make -n" forgotten in previous versions of the test.
* t/txinfo26.sh: Adjust, and don't bother to skip the test when it's
run in a directory whose absolute path contain whitespace: that setup
is not supported anyway.
* t/maken3.sh: Adjust, and fix a typo that could cause a minor false
negative.
* t/test-trs-recover2.sh: Prefer using 'skip_' with a suitable error
message over a bare 'exit 77'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 28 Jun 2012 21:35:18 +0000 (23:35 +0200)]
Merge branch 'maint'

* maint:
  configure: move a misplaced "section" comment
  configure: clump check for ${var%...} and ${var#...} expansion together
  cosmetics: improve wording of a couple of configure messages
  configure: the testsuite shell must support 'test -e' and 'test ! -e'
  tests: remove stale workarounds for Solaris /bin/sh

12 years agoconfigure: move a misplaced "section" comment
Stefano Lattarini [Thu, 28 Jun 2012 21:32:21 +0000 (23:32 +0200)]
configure: move a misplaced "section" comment

* configure.ac (Create output files): This, move it towards the end
of the script.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoconfigure: clump check for ${var%...} and ${var#...} expansion together
Stefano Lattarini [Thu, 28 Jun 2012 21:29:51 +0000 (23:29 +0200)]
configure: clump check for ${var%...} and ${var#...} expansion together

And together with those for the ${var%%...} and ${var##...} expansions.
After all, it is basically impossible to find a shell that support one
of them but not the others.

Suggestion by Eric Blake.

* configure.ac: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocosmetics: improve wording of a couple of configure messages
Stefano Lattarini [Thu, 28 Jun 2012 20:53:03 +0000 (22:53 +0200)]
cosmetics: improve wording of a couple of configure messages

* configure.ac: Fix a couple of messages so that the configure
output changes from this:

    checking whether /bin/sh "set -e" preserves exit traps... yes
    checking whether /bin/sh "set -x" corrupts stderr... no

to this:

    checking whether /bin/sh preserves exit traps with "set -e"... yes
    checking whether /bin/sh corrupts stderr with "set -x"... no

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoconfigure: the testsuite shell must support 'test -e' and 'test ! -e'
Stefano Lattarini [Thu, 28 Jun 2012 20:49:28 +0000 (22:49 +0200)]
configure: the testsuite shell must support 'test -e' and 'test ! -e'

* configure.ac: Require that the shell that is to be selected to run
the testsuite understands "set -e" and "set ! -e".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: remove stale workarounds for Solaris /bin/sh
Stefano Lattarini [Thu, 28 Jun 2012 19:52:37 +0000 (21:52 +0200)]
tests: remove stale workarounds for Solaris /bin/sh

Our testsuite cannot be run with that shell anymore (as it is
not POSIX-compliant).

* t/tap-more.sh: Remove outdated workarounds for Solaris /bin/sh.
* t/self-check-exit.tap: Likewise.
* t/ansi2knr-no-more.sh: Likewise.
* t/add-missing.tap: Likewise.
* t/dist-auxfile.sh: Likewise.
* t/test-driver-custom-multitest-recheck2.sh:  Likewise.
* t/ax/test-init.sh: Remove obsolete references to Solaris
/bin/sh.
* t/confh5.sh: Likewise.
* t/uninstall-fail.sh: Likewise.  And update comments about
quirks of Solaris /bin/ksh and /usr/xpg4/bin/sh.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 28 Jun 2012 16:38:02 +0000 (18:38 +0200)]
Merge branch 'maint'

* maint:
  tests init: don't bother allowing '$me' to be overridable
  tests init: typofixes in comments

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests init: don't bother allowing '$me' to be overridable
Stefano Lattarini [Thu, 28 Jun 2012 16:21:33 +0000 (18:21 +0200)]
tests init: don't bother allowing '$me' to be overridable

We once used that feature in our wrapper tests; but now (and probably
even since commit 'v1.11-1308-g375f23d' of 2011-09-08, "testsuite:
revamp generation of autogenerated tests") it is not needed anymore.
By removing it we can simplify our growingly complex testsuite framework
a little.

* t/ax/test-inist.sh ($me): Do not initialize it here (and only if not
already set), instead ...
* defs-static.in ($me): ... initialize it here unconditionally.
Do not check anymore that $me doesn't come from the environment: that
wouldn't cause any problem now.
Now that '$me' is defined early, prefer it over 'argv0' in early error
messages, both here ...
* defs: ... and here.
* Makefile.am (AM_TESTS_ENVIRONMENT): Do not bother "nullifying" $me
anymore.
* t/self-check-env-sanitize.tap: Adjust.
* t/self-check-me.tap: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests init: typofixes in comments
Stefano Lattarini [Thu, 28 Jun 2012 15:50:20 +0000 (17:50 +0200)]
tests init: typofixes in comments

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 28 Jun 2012 15:41:27 +0000 (17:41 +0200)]
Merge branch 'maint'

* maint:
  tests: one test was not executable, make it so
  readme: fix typo in t/README: s/$((...)/$((...))/
  tests: don't skip if $(abs_builddir) or $(abs_srcdir) contain whitespace
  tests: avoid spurious maintainer-check failures
  tests: remove obsolete hacks around maintainer-check false positives

12 years agotests: one test was not executable, make it so
Stefano Lattarini [Thu, 28 Jun 2012 15:40:10 +0000 (17:40 +0200)]
tests: one test was not executable, make it so

* t/subdir-order.sh: This test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoreadme: fix typo in t/README: s/$((...)/$((...))/
Stefano Lattarini [Thu, 28 Jun 2012 15:32:15 +0000 (17:32 +0200)]
readme: fix typo in t/README: s/$((...)/$((...))/

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: don't skip if $(abs_builddir) or $(abs_srcdir) contain whitespace
Stefano Lattarini [Thu, 28 Jun 2012 15:08:34 +0000 (17:08 +0200)]
tests: don't skip if $(abs_builddir) or $(abs_srcdir) contain whitespace

We used to explicitly skip libtool and gettext tests if the absolute
path of the builddir or of the srcdir which Automake was configured
with contained any whitespace (or other metacharacters).

But several other tests would spuriously fail in such an unholy setup.
To be precise, it would cause 61 'FAIL's and 42 'ERROR's in the whole
Automake testsuite.

The fact that, as of today, nobody has reported any failure of this kind
means that (thankfully) nobody is building automake with $(abs_srcdir)
or $(abs_builddir) mangled by whitespace.  So, instead of trying to cater
to such a broken setup consistently, we just drop the extra check in the
libtool/gettext tests.

In case someone will ever reports a failure due to extra whitespace in
either $(abs_srcdir) or or $(abs_builddir), we will simply enhance our
'configure.ac' to bail out flatly and loudly at such a setup.

* t/ax/test-init.sh: Simplify accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid spurious maintainer-check failures
Stefano Lattarini [Thu, 28 Jun 2012 14:43:43 +0000 (16:43 +0200)]
tests: avoid spurious maintainer-check failures

* t/ax/test-init.sh: Here, by adding extra quoting for two
occurrences of the string "perl".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: remove obsolete hacks around maintainer-check false positives
Stefano Lattarini [Thu, 28 Jun 2012 12:35:12 +0000 (14:35 +0200)]
tests: remove obsolete hacks around maintainer-check false positives

* gen-testsuite-part, t/test-trs-recover.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 28 Jun 2012 11:27:49 +0000 (13:27 +0200)]
Merge branch 'maint'

* maint:
  tests: simpler workaround for shells losing the exit status in exit trap

+ Extra non-trivial edits:
* Several tests: Adjusted to use 'exit' rather than 'Exit'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'simplify-exit-trap-workaround' into maint
Stefano Lattarini [Thu, 28 Jun 2012 11:05:29 +0000 (13:05 +0200)]
Merge branch 'simplify-exit-trap-workaround' into maint

* simplify-exit-trap-workaround:
  tests: simpler workaround for shells losing the exit status in exit trap

+ Extra non-trivial edits:

* t/am-missing-prog.sh: Use 'exit, not 'Exit'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocosmetics: remove trailing whitespace in some files
Stefano Lattarini [Thu, 28 Jun 2012 09:20:43 +0000 (11:20 +0200)]
cosmetics: remove trailing whitespace in some files

* lib/missing, t/comment7.sh, t/objc-flags.sh, t/objcxx-flags.sh,
t/perf/testsuite-summary.sh, t/self-check-explicit-skips.sh: Here.

Prompted by a report from Karl Berry.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: enhance tests in 'missing' script a little
Stefano Lattarini [Thu, 28 Jun 2012 09:09:05 +0000 (11:09 +0200)]
coverage: enhance tests in 'missing' script a little

* t/am-missing-prog.sh: Here, by also verifying its expected
exit status.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Thu, 28 Jun 2012 08:59:45 +0000 (10:59 +0200)]
Merge branch 'maint'

* maint:
  coverage: tests AM_MISSING_PROG usage
  docs: document AM_MISSING_PROG

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: tests AM_MISSING_PROG usage
Stefano Lattarini [Thu, 28 Jun 2012 08:55:13 +0000 (10:55 +0200)]
coverage: tests AM_MISSING_PROG usage

Now that AM_MISSING_PROG is documented, we want to make sure it
works as expected when used in third-party code.

* t/am-missing-prog.sh: New test.
* t/ammissing: Rename ...
* t/am-macro-not-found.sh: ... like this, to avoid confusion (this
test has nothing to do with the 'missing' script nor with the
'AM_MISSING_PROG' macro).
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agodocs: document AM_MISSING_PROG
Eric Blake [Wed, 27 Jun 2012 21:55:14 +0000 (15:55 -0600)]
docs: document AM_MISSING_PROG

Addresses automake bug#11793.

This macro has been present for a long time, and coreutils has been
relying on it despite no documentation, which argues that it is stable
enough to be worth documenting.

Furthermore, since we are hoping to change our preferred invocation
from 'missing --run program' to 'missing program' in a future version
of automake, we need a way for packages to consistently get the
preferred invocation form rather than open-coding a call to 'missing'.
In particular, the Autoconf manual would love to recommend this macro
when discussing how to integrate an autotest suite with automake.

* doc/automake.texi (Public Macros): Document AM_MISSING_PROG.

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

* maint:
  tests: fix a spurious failure with Solaris make
  tests: avoid several spurious failures on Solaris
  tests: avoid a spurious failure on NetBSD