testsuite: Skip tests that use aclocal or automake if they’re too old.
Old versions of aclocal and/or automake can cause several tests to
fail, for two unrelated reasons:
- when used with sufficiently new Perl they might print a “your code
has a minor bug” message on every invocation, causing tests that
check for specific output to choke
- aclocal prior to 1.11.2 does not support --system-acdir
We already had code (in each individual test) to skip tests that depend
on aclocal and/or automake when those programs were *unavailable*, or
when buggy wrapper scripts were detected (apparently some BSDs once
shipped with a wrapper that required you to set an environment variable
before ‘automake’ would do anything at all). Consolidate all of that
code into local.at and augment it to detect the above two problems.
Individual tests that require automake and/or aclocal should now
just say AT_REQUIRE_AUTOMAKE and/or AT_REQUIRE_ACLOCAL at the top.
Individual tests that run autoreconf but *don’t* need a real aclocal
should instead start with AT_SUPPRESS_ACLOCAL, which sets ACLOCAL=true
and creates a dummy aclocal.m4.
While I was at it I noticed that AT_TESTED malfunctions if you have a
shell variable in there that expands to more than one shell word, so I
removed the AT_TESTED line for $M4 $PERL etc and replaced it with a
custom report for the most important system-provided programs that the
testsuite uses. That report now also includes automake and aclocal.
This should fix the problems reported by Sevan Janiyan in
<https://lists.gnu.org/archive/html/bug-autoconf/2023-12/msg00159.html>.
Tested on x86_64-linux against automake 1.11.1, 1.11.2, 1.13.0, and 1.16.5.
* tests/local.at (AT_PREPARE_TESTS): Consolidate code to detect
availability of automake and aclocal here. Also detect Perl
warning messages that will interfere with matching on the output,
and aclocal too old to understand --system-acdir. Produce a custom
report of the versions of system-provided programs we need:
m4, perl, sh, make, and optionally automake and aclocal.
(AT_TESTED): Only list programs that are part of this package.
(AT_REQUIRE_AUTOMAKE, AT_REQUIRE_ACLOCAL, AT_SUPPRESS_ACLOCAL):
New helper macros.
* tests/fortran.at, tests/tools.at, tests/torture.at:
Use AT_REQUIRE_AUTOMAKE, AT_REQUIRE_ACLOCAL, AT_SUPPRESS_ACLOCAL
throughout, as appropriate.