platform/upstream/automake.git
12 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 5 Aug 2012 15:45:07 +0000 (17:45 +0200)]
Merge branch 'maint'

* maint:
  tests: avoid spurious failures with older Texinfo
  tests: avoid tons of spurious failures on NetBSD
  runtest: avoid spurious failures on NetBSD
  news: dependency tracking for Portland Group Compilers is now supported

12 years agotests: avoid spurious failures with older Texinfo
Stefano Lattarini [Sun, 5 Aug 2012 15:11:51 +0000 (17:11 +0200)]
tests: avoid spurious failures with older Texinfo

* t/distcheck-override-infodir.sh (main.texi): Add explicit calls to
'@dircategory' and '@direntry', to ensure a 'dir' file will be created
also by 'install-info' coming with Texinfo 4.8.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid tons of spurious failures on NetBSD
Stefano Lattarini [Sun, 5 Aug 2012 10:14:19 +0000 (12:14 +0200)]
tests: avoid tons of spurious failures on NetBSD

* t/ax/am-test-lib.sh (process_requirements): Set the '$am_tool' variable
to the empty string before trying to unset it; otherwise, we might be
attempting to unset an already-unset variable, which (together with the
presence of the 'errexit' shell flag) causes spurious failures at least
with the /bin/sh shell from NetBSD 5.1.  This was actually causing the
great majority of the Automake tests (all those not using a "required=..."
declaration) to fail spuriously on that platform!

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoruntest: avoid spurious failures on NetBSD
Stefano Lattarini [Sun, 5 Aug 2012 10:05:35 +0000 (12:05 +0200)]
runtest: avoid spurious failures on NetBSD

* runtest.in: Use ${1+"$@"} rather than simply "$@", because the 'set -u'
setting used in the script causes the latter to trigger a spurious error
with the NetBSD 5.1 /bin/sh ("./runtest: @: parameter not set") if there
are no arguments to the test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: dependency tracking for Portland Group Compilers is now supported
Stefano Lattarini [Sun, 5 Aug 2012 09:50:30 +0000 (11:50 +0200)]
news: dependency tracking for Portland Group Compilers is now supported

* NEWS: So document it here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'elisp-work'
Stefano Lattarini [Sun, 5 Aug 2012 09:06:16 +0000 (11:06 +0200)]
Merge branch 'elisp-work'

* elisp-work:
  news: document all the recent elisp-related changes and improvements
  coverage: byte-compiling elisp files in different subdirectories
  elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
  elisp: --batch implies -q, remove -q
  elisp: support elisp files in subdirectories properly
  elisp: simplify suffix rules using emacs '-L' option
  elisp: no need to "absolutize" $(srcdir) and $(builddir) ...
  elisp: prefer $(builddir) files over $(srcdir) ones
  elisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite)
  coverage: elisp path contains $(srcdir) and $(builddir)
  coverage: emacs lisp files in subdirectories

12 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 5 Aug 2012 09:03:40 +0000 (11:03 +0200)]
Merge branch 'maint'

* maint:
  tests: cater to OpenSolaris 'zip'

12 years agotests: cater to OpenSolaris 'zip'
Stefano Lattarini [Sun, 5 Aug 2012 08:32:15 +0000 (10:32 +0200)]
tests: cater to OpenSolaris 'zip'

* t/dist-formats.tap: Here: OpenSolaris zip do not accept the
'--version' option, but accept the '-v' one with a similar
meaning (if no further arguments are given).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 4 Aug 2012 21:45:39 +0000 (23:45 +0200)]
Merge branch 'maint'

* maint:
  tests: fix a spurious XPASS on OpenIndiana
  tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana
  tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana
  tests: reimplement wrappers for automake and aclocal in perl
  tests: work around a ksh bug w.r.t. ${1+"$@"}
  depcomp: style changes to Portland Group Compilers support
  depcomp: initial support for Portland Group Compilers

12 years agotests: fix a spurious XPASS on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 21:03:46 +0000 (23:03 +0200)]
tests: fix a spurious XPASS on OpenIndiana

* t/instspc.tap: Here, by isolating the $(DESTDIR) used by runs with
different "problematic strings" to prevent them to unduly interfering
with each other.  With this, the Automake testsuite finally run cleanly
on the OpenIndiana and Solaris 10 systems I have access to.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 18:38:31 +0000 (20:38 +0200)]
tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana

* t/vala-vapi.sh: Use 'printf', not 'echo', to print strings containing
substrings like '\n', that can be interpreted like escape strings.  That
because the /bin/sh and the /bin/bash shell from OpenIndiana actually
interpret them that way:

  $ /bin/sh -c 'echo "foo\nbar"'
  foo
  bar
  $ /bin/bash -c 'echo "foo\nbar"'
  foo
  bar

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 18:06:28 +0000 (20:06 +0200)]
tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana

On current OpenIndiana (based on what once was OpenSolaris 11), the shell
/bin/sh (which, differently from what happens on Solaris, is a true POSIX
shell, thus worthy of consideration) somehow manages to "eat" the
error message from 'rm' when that fails to remove a file due to lacking
permission on the parent directory:

  $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
  $ echo rc = $?
  rc = 1
  $ /bin/bash -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
  rm: foo not removed: Permission denied
  $ echo rc = $?
  rc = 2
  $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; env rm -f foo"
  rm: foo not removed: Permission denied
  $ echo rc = $?
  rc = 2

That is probably due to an improper optimization, that is, the shell tries
to be smart and remove the file itself instead of invoking 'rm', but fails
spectacularly in the attempt.

* t/uninstall-fail.sh: The just-described bug was causing a spurious
failure in this test case.  Cater to thus situation, by relaxing the
test when a faulty shell is detected.  And while at it, fix and improve
an unrelated comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: reimplement wrappers for automake and aclocal in perl
Stefano Lattarini [Sat, 4 Aug 2012 16:36:24 +0000 (18:36 +0200)]
tests: reimplement wrappers for automake and aclocal in perl

This will allow us to avoid one extra shell invocation per automake
and aclocal invocation in our testsuite, and, more importantly, will
allow us not to worry about potential shell portability issues, at
least in those wrappers.  For an example of such a portability issue,
refer to the recent commit v1.12.2-80-g65dadf6 "tests: work around a
ksh bug w.r.t. ${1+"$@"}".

* t/wrap/automake.in, t/wrap/aclocal.in: Rewritten in perl.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agotests: work around a ksh bug w.r.t. ${1+"$@"}
Stefano Lattarini [Sat, 4 Aug 2012 14:54:30 +0000 (16:54 +0200)]
tests: work around a ksh bug w.r.t. ${1+"$@"}

Fixes automake bug#10898.  See also the older (much older) thread:
<http://lists.gnu.org/archive/html/automake-patches/2009-12/msg00036.html>

At least the AT&T and OpenSolaris versions of the Korn shell, as well
as the /bin/sh from OpenIndiana 11, have a strange bug regarding the
expansion of ${1+"$@"}: when exactly *one empty* argument is passed to
a script run by one of this shells, inside that script ${1+"$@"} will
expand to *nothing*, rather than to to the single empty string, as
one would expect (OTOH, $# will correctly expand to 1).  This buggy
behaviour was causing a spurious failure in our testsuite (test 6 in
't/automake-cmdline.tap').  Work around it.

* t/wrap/automake.in: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: document all the recent elisp-related changes and improvements
Stefano Lattarini [Sat, 4 Aug 2012 13:52:12 +0000 (15:52 +0200)]
news: document all the recent elisp-related changes and improvements

* NEWS (Elisp byte-compilation): Here.  Also notice that the recent
changes have fixed the long-standing (almost two years old!) automake
bug#7441.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agocoverage: byte-compiling elisp files in different subdirectories
Stefano Lattarini [Sat, 4 Aug 2012 13:29:21 +0000 (15:29 +0200)]
coverage: byte-compiling elisp files in different subdirectories

Where a '.el' file in a subdirectory might require a '.el' file in
another one.  This does not work out of the box, but can be made to
work with a judicious use of $(AM_ELCFLAGS) (just introduced in the
previous commit).

* t/lisp-subdir-mix.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoelisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
Stefano Lattarini [Sat, 4 Aug 2012 12:56:27 +0000 (14:56 +0200)]
elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation

* lib/am/lisp.am (.el.elc): Add "$(AM_ELCFLAFS) $(ELCFLAGS)"
to the emacs command line.
* t/lisp-flags.sh: New test.
* t/list-of-tests.mk: Add it.
* doc/automake.texi (Emacs Lisp): Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'depcomp-pgcc' into maint
Stefano Lattarini [Thu, 2 Aug 2012 09:41:28 +0000 (11:41 +0200)]
Merge branch 'depcomp-pgcc' into maint

* depcomp-pgcc:
  depcomp: style changes to Portland Group Compilers support
  depcomp: initial support for Portland Group Compilers

12 years agoMerge branch 'maint'
Stefano Lattarini [Mon, 30 Jul 2012 09:09:27 +0000 (11:09 +0200)]
Merge branch 'maint'

* maint:
  build: fix build in VPATH setup
  gen-tests: simplify sourcing of helper shell files

12 years agobuild: fix build in VPATH setup
Stefano Lattarini [Mon, 30 Jul 2012 09:01:09 +0000 (11:01 +0200)]
build: fix build in VPATH setup

* Makefile.am (t/ax/test-defs.sh): Ensure the 't/ax' directory exists,
before trying to create 'test-defs.sh' in there.  This is required in
VPATH builds.

Reported-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: fix a couple of minor formatting issues
Stefano Lattarini [Thu, 26 Jul 2012 19:02:44 +0000 (21:02 +0200)]
news: fix a couple of minor formatting issues

* NEWS (New in 1.13): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agogen-tests: simplify sourcing of helper shell files
Stefano Lattarini [Thu, 26 Jul 2012 17:40:49 +0000 (19:40 +0200)]
gen-tests: simplify sourcing of helper shell files

This is a follow-up on commit v1.12.2-49-g42fb45b, for an occurrence
of '. "$am_testauxdir"/foo.sh' that wasn't in a test script, but
rather in 'gen-testsuite-part' (ending up in the tests generated by
that script).

* gen-testsuite-part: In the generated 'depcomp*.tap' tests, use
simply:
    . depcomp.sh
rather than:
    . "$am_testauxdir/depcomp.sh"

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 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>
12 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>
12 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'
  ...

12 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

12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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

12 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>
12 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>
12 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>
12 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

12 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>
12 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>
12 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>
12 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

12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 years agonews: minor fixlets and reordering
Stefano Lattarini [Tue, 17 Jul 2012 10:29:37 +0000 (12:29 +0200)]
news: minor fixlets and reordering

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
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 agoMerge branch 'maint'
Stefano Lattarini [Mon, 16 Jul 2012 09:16:15 +0000 (11:16 +0200)]
Merge branch 'maint'

* maint:
  fixup: delete "# serial" line in m4/amversion.in
  news: update about recent ylwrap changes and fixes
  m4: get rid of "# serial" lines
  configure: ${#param} must be supported by the shell for the testsuite
  yacc tests: fix a spurious failure with parallel make
  ylwrap: use proper quoting inside a `...` substitution
  ylwrap: don't uselessly reset the exit status in case of failure
  ylwrap: fix C++ support for Bison
  ylwrap: refactor: move loop invariant
  ylwrap: refactoring: don't rely on the file order
  tests: upgrade and fix Bison test case
  tests: fix bison input file
  ylwrap: comment changes
  ylwrap: modernize idioms
  ylwrap: rename header inclusion in generated parsers
  ylwrap: simplify the list of renamings
  ylwrap: refactor: less duplication

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agofixup: delete "# serial" line in m4/amversion.in
Stefano Lattarini [Mon, 16 Jul 2012 09:11:34 +0000 (11:11 +0200)]
fixup: delete "# serial" line in m4/amversion.in

Otherwise, when m4/amversion.m4 is regenerated, it will contain a
serial line as well.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoMerge branch 'yacc-work' into maint
Stefano Lattarini [Mon, 16 Jul 2012 08:57:41 +0000 (10:57 +0200)]
Merge branch 'yacc-work' into maint

* yacc-work:
  news: update about recent ylwrap changes and fixes
  yacc tests: fix a spurious failure with parallel make
  ylwrap: use proper quoting inside a `...` substitution
  ylwrap: don't uselessly reset the exit status in case of failure
  ylwrap: fix C++ support for Bison
  ylwrap: refactor: move loop invariant
  ylwrap: refactoring: don't rely on the file order
  tests: upgrade and fix Bison test case
  tests: fix bison input file
  ylwrap: comment changes
  ylwrap: modernize idioms
  ylwrap: rename header inclusion in generated parsers
  ylwrap: simplify the list of renamings
  ylwrap: refactor: less duplication

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agonews: update about recent ylwrap changes and fixes
Akim Demaille [Sun, 15 Jul 2012 09:23:59 +0000 (11:23 +0200)]
news: update about recent ylwrap changes and fixes

* NEWS: In ylwrap, renamings are properly propagated, and unknown
files are preserved.

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 agom4: get rid of "# serial" lines
Stefano Lattarini [Sat, 14 Jul 2012 16:49:25 +0000 (18:49 +0200)]
m4: get rid of "# serial" lines

The "#serial" lines are only considered by aclocal for the system-wide
third-party '.m4' files, not for the Automake-provided ones.  So they
serve no real purpose in the Automake '.m4' files.

In addition, now that we use git and topic branches, and that we are also
writing the Automake-NG fork, the "#serial" lines are becoming more and
more unreliable (e.g., different version of the same file in different
branches can easily end up having the same serial numbers).

So let's just nuke all the "#serial" lines.  See also automake bug#11932.

* m4/*.m4: All "# serial" lines removed.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoconfigure: ${#param} must be supported by the shell for the testsuite
Stefano Lattarini [Sat, 14 Jul 2012 16:38:31 +0000 (18:38 +0200)]
configure: ${#param} must be supported by the shell for the testsuite

This will be required at least by the Automake-NG branch.

* configure.ac: Require the $AM_TEST_RUNNER_SHELL supports ${#param} as
a way to obtain the length of the expansion of the variable $param.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoyacc tests: fix a spurious failure with parallel make
Stefano Lattarini [Sat, 14 Jul 2012 10:31:19 +0000 (12:31 +0200)]
yacc tests: fix a spurious failure with parallel make

* t/yacc-bison-skeleton.sh (Makefile.am): Add 'zardoz.h'
to BUILT_SOURCES.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoylwrap: use proper quoting inside a `...` substitution
Stefano Lattarini [Sat, 14 Jul 2012 09:07:34 +0000 (11:07 +0200)]
ylwrap: use proper quoting inside a `...` substitution

* lib/ylwrap ($target): Here, when redefining this to a temporary file.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoylwrap: don't uselessly reset the exit status in case of failure
Stefano Lattarini [Sat, 14 Jul 2012 09:04:42 +0000 (11:04 +0200)]
ylwrap: don't uselessly reset the exit status in case of failure

* lib/ylwrap: Here.  In case of a failure in the wrapped yacc/lex
invocation, '$ret' (holding the final exit status of ylwrap) was
being uselessly reset to '1' in the later if/else.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoylwrap: fix C++ support for Bison
Akim Demaille [Sat, 14 Jul 2012 14:57:02 +0000 (16:57 +0200)]
ylwrap: fix C++ support for Bison

Fixes automake bug#7648.

The current logic of ylwrap is to call yacc in a sub directory, and
pull out of it all the files that were requested on its command line.
Reverse this approach: export *all* the files created in the
subdirectory, but rename them according to what the command says.
This way, extra files, such as position.hh, location.hh and stack.hh
for C++ parsers, but also parser.xml or parser.dot if XML or Dot
output is enabled, will be preserved.

* lib/ylwrap (pairlist): Remove.
(main loop): Don't loop over pairlist, but over the files in the
temporary directory.
* t/list-of-tests.mk (XFAIL_TESTS): Fixes t/yacc-bison-skeleton-cxx.sh.
* THANKS (James Bostock): Add, he reported bug#7648.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoylwrap: refactor: move loop invariant
Akim Demaille [Sat, 14 Jul 2012 08:09:15 +0000 (10:09 +0200)]
ylwrap: refactor: move loop invariant

* lib/ylwrap (input_rx): Move its definition next to its sibling's,
outside of the main loop.

12 years agoylwrap: refactoring: don't rely on the file order
Akim Demaille [Sat, 14 Jul 2012 08:08:52 +0000 (10:08 +0200)]
ylwrap: refactoring: don't rely on the file order

Forthcoming changes will make us iterate over the files in a different
order.

lib/ylwrap (first): Remove, replaced by...
(parser): this.