]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years ago[ng] cleanup: remove on almost-unused global vars: topsrcdir
Stefano Lattarini [Mon, 30 Jul 2012 18:34:12 +0000 (20:34 +0200)] 
[ng] cleanup: remove on almost-unused global vars: topsrcdir

* automake.in ($topsrcdir): Delete, it was only used once ...
(handle_LIBOBJS_or_ALLOCA): ... in here, so it's simpler to inline
its expansion.  Improve formatting of immediately surrounding code
a little while we are at it.
(initialize_per_input): Don't reset the deleted variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove two almost-unused global vars: {am,in}_file_name
Stefano Lattarini [Mon, 30 Jul 2012 18:30:23 +0000 (20:30 +0200)] 
[ng] cleanup: remove two almost-unused global vars: {am,in}_file_name

* automake.in ($am_file_name, $in_file_name): Delete these, which were
used only in the 'read_main_am_file' subroutine; instead ...
(read_main_am_file): ... modify it to only work from the '$makefile_am'
argument (which it was already receiving), and the new '$makefile_in'
argument, which is now passed to it ...
(generate_makefile): ... from here.
(initialize_per_input): Don't reset the two deleted variables anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] general: new internal vars to hold path of current Makefile{,.in,.am}
Stefano Lattarini [Mon, 30 Jul 2012 17:39:12 +0000 (19:39 +0200)] 
[ng] general: new internal vars to hold path of current Makefile{,.in,.am}

This is preferable to having to use the '%MAKEFILE%', '%MAKEFILE-IN%'
and '%MAKEFILE-AM%' transforms in several places, and will enable us
to do more sweeping refactorings in the future.

* automake.in (generate_makefile): Define new private make variables:
  - am.relpath.makefile.am
  - am.relpath.makefile.in
  - am.relpath.makefile
* automake.in (handle_configure, handle_clean, generate_makefile),
lib/am/configure.am, lib/am/check-typos.am, lib/am/clean.am: Adjust
throughout to use them instead of the corresponding transforms.
* t/remake.sh: Adjust and extend grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] clean: prefer '#' comments over '##' ones
Stefano Lattarini [Mon, 30 Jul 2012 17:07:26 +0000 (19:07 +0200)] 
[ng] clean: prefer '#' comments over '##' ones

* lib/am/clean.am: Here.  So that they will be visible also in
the generated Makefiles.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: improve few comments
Stefano Lattarini [Mon, 30 Jul 2012 16:56:28 +0000 (18:56 +0200)] 
[ng] cosmetics: improve few comments

* automake.in (slurp_makefile_fragment): Here.
* lib/am/texibuild.am (am__texibuild_dvi_or_pdf): And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read in 'header-vars.am' with '&verbatim'
Stefano Lattarini [Mon, 30 Jul 2012 16:51:16 +0000 (18:51 +0200)] 
[ng] refactor: read in 'header-vars.am' with '&verbatim'

* automake.in (define_standard_variables): Here.  We can do so easily
now that we've made the 'verbatim' function polymorphic.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: make '&verbatim' polymorphic in its return value
Stefano Lattarini [Mon, 30 Jul 2012 16:36:18 +0000 (18:36 +0200)] 
[ng] refactor: make '&verbatim' polymorphic in its return value

* automake.in (verbatim): If used in empty context, continue to act
as before, and append the read makefile fragment to '$output_verbatim'.
But if used in scalar or list context, return it instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: can copy makefile fragments really verbatim
Stefano Lattarini [Mon, 30 Jul 2012 16:27:08 +0000 (18:27 +0200)] 
[ng] automake: can copy makefile fragments really verbatim

This will allow us to actually put such fragments in distributed
files, and then include them *at make runtime*, instead of copying
their contents in every single makefile (as is done now, a legacy
from mainline Automake).

* automake.in (verbatim): New function, will copy the given file
"verbatim" (excluding removal of '##' comments) in the output
Makefile.
(handle_tests): Use 'verbatim', not 'almost_verbatim', to include
files 'color-tests.am', 'serial-tests.am' and 'parallel-tests.am'.
(handle_texinfo): Likewise, for 'texibuild.am'.
(generate_makefile): Likewise, for 'common-targets.am' and
'am-dir.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: new function 'slurp_makefile_fragment'
Stefano Lattarini [Mon, 30 Jul 2012 15:54:40 +0000 (17:54 +0200)] 
[ng] automake: new function 'slurp_makefile_fragment'

This is a pure refactoring, with no semantic change intended.
It will be required by future changes.

* automake.in (slurp_makefile_fragment): New.
(preprocess_file): Use it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: handle 'all', 'check' and 'install' target in on '.am' file
Stefano Lattarini [Mon, 30 Jul 2012 15:39:05 +0000 (17:39 +0200)] 
[ng] refactor: handle 'all', 'check' and 'install' target in on '.am' file

* lib/am/common-targets.am: New file, superseding and encompassing ...
* lib/am/check-target.am, all-target.am, lib/am/install.am: ... these
ones.
* Makefile.am (dist_am_DATA): Adjust.
* automake.in (handle_all_and_check): Remove.
(generate_makefile): Adjust: include 'common-targets.am' "almost
verbatim".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: move hack for libtool installs from automake to install.am
Stefano Lattarini [Mon, 30 Jul 2012 14:58:40 +0000 (16:58 +0200)] 
[ng] refactor: move hack for libtool installs from automake to install.am

* automake.in (generate_makefile): Move the hack necessary to make the
installation of libtool libraries and binaries dependent on them work
"on degenerate systems even with make -j" (according to the comments of
the original authors :-) from here ...
* lib/am/install.am: ... to here, with improved comments.

For the origin of the hack we are moving around here, refer to commit
bd4a1d5 of 2000-10-19, "* automake.in (handle_merge_targets): Allow
parallel install with forced relink".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] dejagnu: remove an obsolete comment
Stefano Lattarini [Mon, 30 Jul 2012 14:32:35 +0000 (16:32 +0200)] 
[ng] dejagnu: remove an obsolete comment

* lib/am/dejagnu.am (check-DEJAGNU): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: merge '&handle_tests_dejagnu' into '&handle_tests'
Stefano Lattarini [Mon, 30 Jul 2012 14:04:00 +0000 (16:04 +0200)] 
[ng] automake: merge '&handle_tests_dejagnu' into '&handle_tests'

* automake.in (handle_tests_dejagnu): This is just a trivial
one-liner now, so merge it ...
(handle_tests): ... in here.  And remove a redundant heading
comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] all: deps for the 'all' target listed in '$(am.all.targets)'
Stefano Lattarini [Mon, 30 Jul 2012 13:36:58 +0000 (15:36 +0200)] 
[ng] all: deps for the 'all' target listed in '$(am.all.targets)'

* automake.in (handle_all_and_check): Drop transform 'ALL-DEPS' when
processing the 'all-target.am' file.
(generate_makefile): Define '$(am.all.targets)' as the list of
dependencies for the 'all' target.
* lib/am/all-target.am: Use it instead of the transform '%ALL-DEPS%'.
* t/java.sh: Relax grepping checks to avoid spurious failures.
* t/amopts-variable-expansion.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: drop redundant use of a transform
Stefano Lattarini [Mon, 30 Jul 2012 12:52:10 +0000 (14:52 +0200)] 
[ng] cleanup: drop redundant use of a transform

* lib/am/all-target.am: Use '$(am.config-hdr.local)' directly,
instead of the '%LOCAL-HEADERS%' transform.
* automake.in (handle_all_and_check): Drop that transform.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: remove useless code duplication
Stefano Lattarini [Mon, 30 Jul 2012 12:22:56 +0000 (14:22 +0200)] 
[ng] automake: remove useless code duplication

This is a pure refactoring with no semantic changes intended.

* automake.in (handle_all_and_check, handle_tags): Do not re-calculate
the list of "local" input or output header files (specified by
AC_CONFIG_HEADERS in configure.ac); that is already saved in the internal
make variables '$(am.config-hdr.local)' and '$(am.config-hdr.local.in)'.
Simply use these variables instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: list input config headers in an internal make variable as well
Stefano Lattarini [Mon, 30 Jul 2012 12:47:04 +0000 (14:47 +0200)] 
[ng] vars: list input config headers in an internal make variable as well

This is only a preparatory change in view of future refactorings.

* automake.in (handle_config_headers): Define a new make variable
'am.config-hdr.local.in'.
* t/confh-internals.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: separate config headers in two vars (local and non-local ones)
Stefano Lattarini [Mon, 30 Jul 2012 12:19:00 +0000 (14:19 +0200)] 
[ng] vars: separate config headers in two vars (local and non-local ones)

Where the "local" are those which are in the same subdirectory of the
Makefile.am being currently processed, and the "non-local" ones are
not (and thus need to be prepended with $(top_builddir)).

* automake.in (handle_config_headers): Define two new make variables
'am.config-hdr.local' and 'am.config-hdr.non-local'.  Accordingly,
define 'AM_CONFIG_HEADERS' as the union of them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: move processing of config-header rules in its own function
Stefano Lattarini [Mon, 30 Jul 2012 12:12:11 +0000 (14:12 +0200)] 
[ng] automake: move processing of config-header rules in its own function

This is a pure refactoring with no semantic changes intended.  It will
only be useful for future changes.

* automake.in (handle_configure): Move definition of $(AM_CONF_HEADERS)
from here ...
(handle_config_headers): ... to this new function, which will also ensure
that the $(AM_CONFIG_HEADERS) will always be defined (albeit possibly to
an empty value).
(generate_makefile): Call the new variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: avoid extra recursive make invocations
Stefano Lattarini [Mon, 30 Jul 2012 10:01:52 +0000 (12:01 +0200)] 
[ng] check: avoid extra recursive make invocations

After this change, "make check" will not cause any recursive make
invocation by default (unless there are $(SUBDIRS) to descend into, of
course).  One little price to pay is that the targets 'check-TESTS',
'check-DEJAGNU' and 'check-local' will always be defined (being dummy
by default).  The other one is that the old semantics are not 100%
preserved, so corner cases that worked in mainline Automake might not
work anymore out-of-the-box with Automake-NG, thus requiring the user
to make his dependency declarations more complete or precises.
We believe these prices are well worth paying.

* lib/am/check-target.am: Rewrite 'check-am' handling to avoid the
extra make recursion(s).  A side effect of this is that the transform
'%CHECK-DEPS%' is no more needed.  Accordingly ...
* automake.in (@check_tests): ... drop definition and updating of this
variable throughout, and ...
(handle_all_and_check): ... the definition of the '%CHECK-TESTS%'
transform when processing the 'check-target.am' file.
* t/local-targets.sh: Adjust to avoid spurious failures.
* t/checkall.sh: Remove, it's quite obsolete (and has just started
to spuriously fail).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: deps for 'check' target listed in '$(am.test-suite.deps)'
Stefano Lattarini [Mon, 30 Jul 2012 09:25:03 +0000 (11:25 +0200)] 
[ng] check: deps for 'check' target listed in '$(am.test-suite.deps)'

* automake.in (handle_all_and_check, handle_tests): Drop transform
'CHECK-DEPS' when processing (respectively) the files 'check-target.am'
and 'parallel-tests.am'.
(generate_makefile): Define '$(am.test-suite.deps)' as the list of
dependencies for the 'check' target.
* lib/am/parallel-tests.am, lib/am/check-target.am: Use it instead
of the transform '%CHECK-DEPS%'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Mon, 30 Jul 2012 09:31:28 +0000 (11:31 +0200)] 
Merge branch 'master' into ng/master

* master:
  build: fix build in VPATH setup
  news: fix a couple of minor formatting issues
  gen-tests: simplify sourcing of helper shell files

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

13 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>
13 years ago[ng] rename: am__check_cook_with_exeext -> am.test-suite.cook-with-exeext
Stefano Lattarini [Mon, 30 Jul 2012 08:33:28 +0000 (10:33 +0200)] 
[ng] rename: am__check_cook_with_exeext -> am.test-suite.cook-with-exeext

* lib/am/serial-tests.am: Here.  Also, rename 'am__check_cook_with_exeext_1'
as 'am.test-suite.cook-with-exeext.helper'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] parallel-tests: define $(TEST_SUITE_LOG) in makefile fragment
Stefano Lattarini [Mon, 30 Jul 2012 08:03:58 +0000 (10:03 +0200)] 
[ng] parallel-tests: define $(TEST_SUITE_LOG) in makefile fragment

* lib/am/parallel-tests.am: Here (unless already defined) ...
* automake.in (handle_tests): ... rather than here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am.abs-dir -> am.dir.abs, am.abs-top-dir -> am.top-dir.abs
Stefano Lattarini [Mon, 30 Jul 2012 07:56:24 +0000 (09:56 +0200)] 
[ng] rename: am.abs-dir -> am.dir.abs, am.abs-top-dir -> am.top-dir.abs

Suggested by Akim Demaille:
<http://lists.gnu.org/archive/html/automake-ng/2012-07/msg00228.html>

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: consider $(EXEEXT) used if non-empty at make runtime
Stefano Lattarini [Mon, 30 Jul 2012 07:40:05 +0000 (09:40 +0200)] 
[ng] refactor: consider $(EXEEXT) used if non-empty at make runtime

To check whether we should handle $(EXEEXT), simply check for
"ifdef EXEEXT" in our Makefile fragments, rather than also checking
whether EXEEXT has been set as a configure-time AC_SUBST.  This
simplifies the logic, and move it completely at make runtime, rather
than having it split between automake runtime (to decide whether
EXEEXT is AC_SUBST) and make runtime (to decide whether $(EXEEXT) is
empty).

* lib/am/header-vars.am (EXEEXT): Default to empty.  This is required
to avoid environment interferences.
(am.conf.handle-exeext): Define this no more.
* lib/am/parallel-tests.am, lib/am/serial-tests.am: Simply look
at $(EXEEXT), rather than using $(am.conf.handle-exeext), or the
'%?HANDLE-EXEEXT%' transform.
* automake.in (process_file): Don't define that transform anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: do not run very expensive tests by default
Stefano Lattarini [Sat, 28 Jul 2012 09:54:27 +0000 (11:54 +0200)] 
[ng] tests: do not run very expensive tests by default

Some tests in the Automake testsuite (especially those testing for bugs
w.r.t. command-line length limits) require a *long* time to run.  For
example, the test 'parallel-tests-many.sh' (the most extreme example of
this issue) takes ~ 11 minutes to execute on a modern, blazingly fast
multi-core ppc64 system (64 cores at 3.5 GHz each).

This slow-down is unacceptable during routine runs of the testsuite,
that I do every bunch of commits (or every commit, for more tricky
changes).  And is even less acceptable for the casual user that just
run the testsuite before installing Automake, maybe on an aging and
slower system (or maybe on Cygwin *shudder*).

So, let's follow the route of GNU coreutils here: declare some tests as
"expensive", and let them run only if called if the RUN_EXPENSIVE_TESTS
environment variable is set to "yes".

* test-lib.sh (expensive_): New function; used in a test, cause it to be
skipped unless the RUN_EXPENSIVE_TESTS variable is defined to "yes".
* t/parallel-tests-many.sh, t/testsuite-summary-count-many.sh,
t/dist-many.sh: Call 'expensive_'.
* runtest.in: Export RUN_EXPENSIVE_TESTS to "yes": if a test is called
directly through './runtest', it should be run even it it's expensive.
* Makefile.am (check-expensive, installcheck-expensive): New convenience
targets that run the testsuite with RUN_EXPENSIVE_TESTS exported to
"yes", so that the expensive tests are not skipped.
* t/README: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] serial-tests: remove one level of indentation in a recipe
Stefano Lattarini [Sat, 28 Jul 2012 08:59:08 +0000 (10:59 +0200)] 
[ng] serial-tests: remove one level of indentation in a recipe

* lib/am/serial-tests.am (check-TESTS): Here.  And add a few comments.
These changes make the already quite complicated recipe slightly easier
to follow.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__dir -> am.dir, am__abs_dir -> am.abs-dir, etc.
Stefano Lattarini [Sat, 28 Jul 2012 08:34:03 +0000 (10:34 +0200)] 
[ng] rename: am__dir -> am.dir, am__abs_dir -> am.abs-dir, etc.

Complete list of renames:

  am__dir          ->  am.dir
  am__abs_dir      ->  am.abs-dir
  am__top_dir      ->  am.top-dir
  am__abs_top_dir  ->  am.abs-top-dir

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactor 'am.test-suite.handle-suffix'
Stefano Lattarini [Fri, 27 Jul 2012 23:39:57 +0000 (01:39 +0200)] 
[ng] check: refactor 'am.test-suite.handle-suffix'

* lib/am/parallel-tests.am (am.test-suite.handle-suffix.helper):
New, extracted from ...
(am.test-suite.handle-suffix): ... this, which now uses it.
(am__tpfx): Remove, inlined into 'am.test-suite.handle-suffix'.
* t/parallel-tests-internals.sh: Remove as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: fix an occurrence of inconsistent indentation
Stefano Lattarini [Fri, 27 Jul 2012 22:56:02 +0000 (00:56 +0200)] 
[ng] cosmetics: fix an occurrence of inconsistent indentation

* lib/am/parallel-tests.am: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: use new function 'am.vars.is-undef' ...
Stefano Lattarini [Fri, 27 Jul 2012 22:52:45 +0000 (00:52 +0200)] 
[ng] refactor: use new function 'am.vars.is-undef' ...

* lib/am/header-vars.am (SUBDIRS): ... in the definition of this (instead
of using hand-rolled almost-equivalent) ...
($(1)LOG_DRIVER, TEST_EXTENSIONS): ... and of these (instead of resorting
to weaker and unsafer '?=' assignment).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] utils: new function 'am.vars.is-undef'
Stefano Lattarini [Fri, 27 Jul 2012 18:30:11 +0000 (20:30 +0200)] 
[ng] utils: new function 'am.vars.is-undef'

Sometimes, in our makefiles, we want to assign a default value to
a variable that might not have been assigned yet.  One might think
that using the GNU make assignment '?=' is enough:

    VAR ?= DEFAULT-VALUE

But alas, such a usage allows interferences from the environment; i.e.,
if an environment variable named 'VAR' is defined to, say, BAD-VALUE,
the construct above will result in the $(VAR) make variable being
defined to BAD-VALUE, not to DEFAULT-VALUE.

Use the 'am.vars.is-undef' function to avoid this situation.  It tells
whether the given make variable is not "safely" defined, i.e., either
undefined, or defined to a value that is inherited from the environment.

With such a tool, we can safely declare default values for variables
that avoids environmental interferences, as follow:

    ifeq ($(call am.vars.is-undef,VAR),yes)
      VAR = DEFAULT-VALUE
    endif

* lib/am/header-vars.am (am.vars.is-undef): New.
* t/internals.tap: Test it, and add few sanity checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: tests on internal stuff is more resilient now
Stefano Lattarini [Fri, 27 Jul 2012 17:46:28 +0000 (19:46 +0200)] 
[ng] tests: tests on internal stuff is more resilient now

* t/internals.tap: Reorganize the test script to minimize the
possibility of one test failure messing up all the other ones.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: simplify munging of header-vars.am ...
Stefano Lattarini [Fri, 27 Jul 2012 17:26:11 +0000 (19:26 +0200)] 
[ng] tests: simplify munging of header-vars.am ...

* t/am-xargs-map.sh, t/ensure-dir-exists.sh, t/internals.tap,
t/memoize.tap: ... here, since that files no more contains
'@foo@' substitutions nor '?COND?' transforms.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'color-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 17:19:51 +0000 (19:19 +0200)] 
[ng] refactor: read 'color-tests.am' more verbatim

* lib/am/color-tests.am (am.test-suite.tty-colors): Define with the
'define' built-in rather than with '='.
* automake.in (handle_tests): Use '&almost_verbatim' rather than
'&file_contents' to read and process 'color-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'serial-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 16:44:05 +0000 (18:44 +0200)] 
[ng] refactor: read 'serial-tests.am' more verbatim

* lib/am/serial-tests.am: Adjust to use the "ifeq" built-in and
the internal variable '$(am.conf.handle-exeext)' instead of the
transform '%?HANDLE-EXEEXT%'.
* automake.in (handle_tests): Use '&almost_verbatim' rather than
'&file_contents' to read and process 'serial-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: use few more GNU make capabilities
Stefano Lattarini [Fri, 27 Jul 2012 14:33:08 +0000 (16:33 +0200)] 
[ng] check: use few more GNU make capabilities

We can do so now that the 'parallel-tests.am' file is now
processed "almost verbatim" by Automake.

* lib/am/parallel-tests.am (check-TESTS): Here, use "ifeq" to check
whether $(AM_LAZY_CHECK) is "yes".  This removes the need for ...
(am__remove_if_not_lazy_check): ... this variable, which has thus
been removed.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: prefer '#' over '##' for some comments
Stefano Lattarini [Fri, 27 Jul 2012 14:19:47 +0000 (16:19 +0200)] 
[ng] check: prefer '#' over '##' for some comments

* lib/am/parallel-tests.am: Here.  This will make it easier for someone
reading the generated Makefile.in to understand what is going on.

13 years ago[ng] cosmetics: remove a partly obsolete, partly redundant comment
Stefano Lattarini [Fri, 27 Jul 2012 14:13:01 +0000 (16:13 +0200)] 
[ng] cosmetics: remove a partly obsolete, partly redundant comment

* lib/am/parallel-tests.am (recheck): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'parallel-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 13:23:52 +0000 (15:23 +0200)] 
[ng] refactor: read 'parallel-tests.am' more verbatim

* automake.in (handle_tests): Process 'parallel-tests.am' with
'&almost_verbatim', not with '&file_contents'.  As a related
change, we now *must* include 'color-tests.am' explicitly.
* lib/am/parallel-tests.am: Related adjustments.  In particular,
remove use of explicit '!' verbatim-escaping of some sections,
and do not try to include 'color-tests.am'.
* lib/am/serial-tests.am: Do not include 'color-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: improve a comment
Stefano Lattarini [Fri, 27 Jul 2012 13:01:43 +0000 (15:01 +0200)] 
[ng] cosmetics: improve a comment

* lib/am/parallel-tests.am (am.test-suite.test-bases): About this variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__is_xfail_test -> -> am.test-suite.is-xfail
Stefano Lattarini [Fri, 27 Jul 2012 12:55:36 +0000 (14:55 +0200)] 
[ng] rename: am__is_xfail_test -> -> am.test-suite.is-xfail

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__test_* -> am.test-suite.test-*
Stefano Lattarini [Fri, 27 Jul 2012 12:54:23 +0000 (14:54 +0200)] 
[ng] rename: am__test_* -> am.test-suite.test-*

That is:

    am__test_bases    ->  am.test-suite.test-bases
    am__test_logs     ->  am.test-suite.test-logs
    am__test_results  ->  am.test-suite.test-results

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__xfail_test_bases -> am.test-suite.xfail-test-bases
Stefano Lattarini [Fri, 27 Jul 2012 12:46:38 +0000 (14:46 +0200)] 
[ng] rename: am__xfail_test_bases -> am.test-suite.xfail-test-bases

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__get_test_bases -> am.test-suite.get-test-bases
Stefano Lattarini [Fri, 27 Jul 2012 12:38:12 +0000 (14:38 +0200)] 
[ng] rename: am__get_test_bases -> am.test-suite.get-test-bases

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__count_test_result -> am.test-suite.count-results
Stefano Lattarini [Fri, 27 Jul 2012 12:33:55 +0000 (14:33 +0200)] 
[ng] rename: am__count_test_result -> am.test-suite.count-results

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__handle_per_suffix_test -> am.test-suite.handle-suffix
Stefano Lattarini [Fri, 27 Jul 2012 12:20:31 +0000 (14:20 +0200)] 
[ng] rename: am__handle_per_suffix_test -> am.test-suite.handle-suffix

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__runtest -> am.test-suite.runtest
Stefano Lattarini [Fri, 27 Jul 2012 12:18:17 +0000 (14:18 +0200)] 
[ng] rename: am__runtest -> am.test-suite.runtest

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: update a couple of outdated references in comments
Stefano Lattarini [Fri, 27 Jul 2012 12:09:47 +0000 (14:09 +0200)] 
[ng] cosmetics: update a couple of outdated references in comments

* lib/tap-driver.pl, lib/test-driver: Here, about synchronization of
definition of ANSI color escapes with the relevant makefile fragments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__tty_colors -> am.test-suite.tty-colors
Stefano Lattarini [Fri, 27 Jul 2012 12:04:24 +0000 (14:04 +0200)] 
[ng] rename: am__tty_colors -> am.test-suite.tty-colors

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__rst_title -> am.test-suite.rst-title
Stefano Lattarini [Fri, 27 Jul 2012 12:02:28 +0000 (14:02 +0200)] 
[ng] rename: am__rst_title -> am.test-suite.rst-title

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__create_global_log -> am.test-suite.create-global-log
Stefano Lattarini [Fri, 27 Jul 2012 12:00:54 +0000 (14:00 +0200)] 
[ng] rename: am__create_global_log -> am.test-suite.create-global-log

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am.test-harness.* -> am.test-suite.*
Stefano Lattarini [Fri, 27 Jul 2012 11:31:09 +0000 (13:31 +0200)] 
[ng] rename: am.test-harness.* -> am.test-suite.*

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__list_recheck_tests -> am.test-suite.list-tests-to-recheck
Stefano Lattarini [Fri, 27 Jul 2012 11:28:30 +0000 (13:28 +0200)] 
[ng] rename: am__list_recheck_tests -> am.test-suite.list-tests-to-recheck

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__list_recheck_tests -> am.test-suite-list-recheck
Stefano Lattarini [Fri, 27 Jul 2012 11:26:26 +0000 (13:26 +0200)] 
[ng] rename: am__list_recheck_tests -> am.test-suite-list-recheck

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__copy_in_global_log_rx -> am.test-suite.rx.copy-in-global-log
Stefano Lattarini [Fri, 27 Jul 2012 11:22:03 +0000 (13:22 +0200)] 
[ng] rename: am__copy_in_global_log_rx -> am.test-suite.rx.copy-in-global-log

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__global_test_result_rx -> am.test-suite.rx.global-result
Stefano Lattarini [Fri, 27 Jul 2012 11:18:13 +0000 (13:18 +0200)] 
[ng] rename: am__global_test_result_rx -> am.test-suite.rx.global-result

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__recheck_rx -> am.test-suite.rx.recheck
Stefano Lattarini [Fri, 27 Jul 2012 11:03:06 +0000 (13:03 +0200)] 
[ng] rename: am__recheck_rx -> am.test-suite.rx.recheck

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__test_result_rx -> am.test-suite.rx.result
Stefano Lattarini [Fri, 27 Jul 2012 11:01:39 +0000 (13:01 +0200)] 
[ng] rename: am__test_result_rx -> am.test-suite.rx.result

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: reduce code duplication in some auxiliary variables
Stefano Lattarini [Fri, 27 Jul 2012 10:08:01 +0000 (12:08 +0200)] 
[ng] check: reduce code duplication in some auxiliary variables

* lib/am/parallel-tests.am (am.test-suite.awk-trs-loop/BEGIN,
am.test-suite.awk-trs-loop/END, am.test-suite.awk-functions): New, hold
fragments of awk scripts extracted from (and common to) ...
(am__create_global_log, am__count_test_result): ... these variables.
Some related improvements to comments, and minor reformatting.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix a spurious failure
Stefano Lattarini [Fri, 27 Jul 2012 09:28:37 +0000 (11:28 +0200)] 
[ng] tests: fix a spurious failure

* t/override-conditional-1.sh: Here, due to the recent edits
of 'lib/am/header-vars.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: fix some font-lock problems for vim
Stefano Lattarini [Fri, 27 Jul 2012 09:22:08 +0000 (11:22 +0200)] 
[ng] cosmetics: fix some font-lock problems for vim

* lib/am/parallel-tests.am: Here, by avoiding few occurrences of
the single-quote characters in comments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: prefer '#' comments over '##' ones; improve few comments
Stefano Lattarini [Fri, 27 Jul 2012 09:13:26 +0000 (11:13 +0200)] 
[ng] header vars: prefer '#' comments over '##' ones; improve few comments

* lib/am/header-vars.am: Here, throughout the file.  This will make it
easier for someone reading the generated Makefile.in to understand what
it's going on.  And improve/fix few existing comments while at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: fix comment on why DESTDIR is not explicitly initialized
Stefano Lattarini [Fri, 27 Jul 2012 08:38:49 +0000 (10:38 +0200)] 
[ng] header vars: fix comment on why DESTDIR is not explicitly initialized

* lib/am/header-vars.am (DESTDIR): It's because we want to allow it to
be defined from the environment, for compatibility with mainline Automake.
For better clarity, define an (empty) default with the line "DESTDIR ?=",
instead of with the commented-out definition "# DESTDIR=".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: remove variable $(am__sh_e_setup)
Stefano Lattarini [Fri, 27 Jul 2012 08:32:58 +0000 (10:32 +0200)] 
[ng] vars: remove variable $(am__sh_e_setup)

The comments to that variable claimed that "set +e" in the shell was
an XSI extension, but the Automake testsuite since at least 1.11 (which
was run several times with some weak, non-POSIX vendor /bin/sh) used it
in the test script, with not problem whatsoever.  So we don't actually
need the safety net provided by $(am__sh_e_setup): we can simply use
'set +e' in the relevant recipes.

* lib/am/header-vars.am (am__sh_e_setup): Remove.
* lib/am/parallel-tests.am: Remove usages; simply inline 'set +e' instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: less use of @SUBST@ occurrences
Stefano Lattarini [Fri, 27 Jul 2012 08:24:28 +0000 (10:24 +0200)] 
[ng] header vars: less use of @SUBST@ occurrences

* lib/am/header-vars.am: Use $(PACKAGE) and $(srcdir) throughout
rather than @PACKAGE@ and @srcdir@.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: move check for GNU make version earlier
Stefano Lattarini [Fri, 27 Jul 2012 08:18:13 +0000 (10:18 +0200)] 
[ng] header vars: move check for GNU make version earlier

* lib/am/header-vars.am: Move the check that the version of GNU make
in use is modern enough before everything else.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: remove few old redundant variables
Stefano Lattarini [Fri, 27 Jul 2012 08:11:48 +0000 (10:11 +0200)] 
[ng] header vars: remove few old redundant variables

* lib/am/header-vars.am (target_triplet, host_triplet, build_triplet):
Remove these, redundant because aliases respectively for the variables
$(target), $(host) and $(build).  See also:
<http://lists.gnu.org/archive/html/automake/2012-07/msg00058.html>
* lib/am/dejagnu.am: Adjust.
* NG-NEWS: Update.
* doc/automake-ng.texi: Adjust.

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

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

+ Extra non-trivial edits:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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