[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.
[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.
[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.
[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.
[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'.
[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".
[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.
[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.
* 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.
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.
[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.
[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.
[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).
[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%'.
* 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.
[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.
[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.
[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.
* 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.
[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).
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.
[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.
[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'.
[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'.
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.
[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'.
[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.
[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.
[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=".
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.
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"
* 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.
* 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'
...
* 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'
...
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.
* 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.
* 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.
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.
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.
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.
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.
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.
* 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'.
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.
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".