diff options
author | Zack Weinberg <zackw@panix.com> | 2020-09-12 14:59:56 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-09-22 15:46:42 -0400 |
commit | 1d4b7c049e6a8e918a0ca3361418cf7776f2e6fa (patch) | |
tree | d04d571ee5faea6804c47fd1e2599fd543bb2c3e /tests | |
parent | 8285f302a95021670d733a59ee690a56edb8a5b0 (diff) | |
download | autoconf-1d4b7c049e6a8e918a0ca3361418cf7776f2e6fa.tar.gz |
Manually sync ChannelDefs.pm from automake.
ChannelDefs.pm *ought* to be kept in sync between automake and autoconf,
because it defines the set of valid -W options, and autoreconf assumes
that it can pass arbitrary -W options to all of the tools it invokes.
However, it isn’t covered by either project’s ‘make fetch’ and it hasn’t
actually *been* in sync for more than 17 years.
This patch manually brings over all of the changes made on the
automake side. Once the complementary patch is applied by the
automake team, both versions of the file will be the same, and then we
can add it to the list in fetch.pl and not have this problem any more
in the future.
There are some user-visible consequences to bringing this file back
into sync. The only one worth mentioning in NEWS is that the ‘obsolete’
category of warnings is now on by default. This had quite a bit of
fallout throughout the testsuite. There are also some new warning
categories that get mentioned in --help output, but we don’t actually
generate any warnings in those categories, so people using ‘-Wall’
won’t see any change. More diagnostics are automatically tagged with
‘warning:’ or ‘error:’, which also had some fallout in the testsuite.
Finally, ‘-Werror’ no longer causes complaints about unknown warning
categories to be treated as hard errors.
Internally, there are some small API changes: ‘parse_warnings’ is no
longer usable as a ‘getopt’ callback function, and we now have a stub
Autom4te/Config.pm to match the automake code’s expectations. (This
file *should* also be synced from automake by ‘make fetch’, but we
can’t quite do that yet because it’s a generated file and our build
system is not prepared to handle adding *two* directories to @INC when
running a not-yet-installed Perl script. I plan to fix that after 2.70.)
As a side-effect of adding a Config.pm, ‘prog_error’ now says to
report the bug to bug-autoconf, not bug-automake. If this is why we
mostly haven’t been using prog_error for internal errors, we can stop
avoiding it. (I did not change anything to use prog_error in this
patch.)
* lib/Autom4te/ChannelDefs.pm: Merge from automake.
* lib/Autom4te/Config.pm: New file.
* lib/local.mk (dist_perllib_DATA): Add Autom4te/Config.pm.
* bin/autoconf.as: Update list of warning categories to match
Autom4te::ChannelDefs::usage.
* bin/autoheader.in (@warnings): New global.
(parse_args): Don’t use parse_warnings as a getopt callback.
(main): Add warnings options from our command line to $autoconf.
No need to turn on 'obsolete' warnings explicitly.
No need to include "warning: " in warning messages.
* bin/autom4te.in (parse_args): Don’t use parse_warnings as a getopt callback.
(main): No need to include "warning: " in warning messages.
* bin/autoreconf.in (parse_args): parse_warnings now takes only one argument.
* bin/autoupdate.in: Set WARNINGS=none in environment for all child processes.
* tests/local.at
(AT_CHECK_M4): Handle `autom4te: error: /usr/bin/m4 ...` like
`autom4te: /usr/bin/m4 ...`.
(_AT_CHECK_AC_MACRO): Add AUTOCONF-FLAGS argument, passed to both
autoconf and autoheader.
(AT_CHECK_MACRO): Default AUTOCONF-FLAGS argument to empty.
Pass that argument to autoheader as well as autoconf.
(AT_CHECK_AU_MACRO): Expect a “macro ‘NAME’ is obsolete’ diagnostic
on the first run of autoconf. Pass -Wno-obsolete to autoconf on the
second run, and to autoheader on both runs.
* tests/base.at
* tests/c.at
* tests/compile.at
* tests/m4sh.at
* tests/m4sugar.at
* tests/semantics.at
* tests/tools.at
* tests/torture.at:
No need to pass -Wobsolete to autoconf.
Pass -Wno-obsolete to autoheader where needed to avoid handling
the same warning twice.
Update various expectations for diagnostics to match behavior
changes.
* tests/tools.at (autoupdating AU_ALIAS): Add an AC_CONFIG_HEADERS
line to the test configure.ac to eliminate an unrelated diagnostic.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/base.at | 2 | ||||
-rw-r--r-- | tests/c.at | 2 | ||||
-rw-r--r-- | tests/compile.at | 7 | ||||
-rw-r--r-- | tests/local.at | 52 | ||||
-rw-r--r-- | tests/m4sh.at | 2 | ||||
-rw-r--r-- | tests/m4sugar.at | 25 | ||||
-rw-r--r-- | tests/semantics.at | 34 | ||||
-rw-r--r-- | tests/tools.at | 54 | ||||
-rw-r--r-- | tests/torture.at | 5 |
9 files changed, 120 insertions, 63 deletions
diff --git a/tests/base.at b/tests/base.at index 6894990a..6a1d9742 100644 --- a/tests/base.at +++ b/tests/base.at @@ -81,7 +81,7 @@ AT_DATA([configure.ac], AT_CHECK_AUTOCONF([], [1], [], [[configure.ac:1: error: AC_REQUIRE(AC_PROG_CC): cannot be used outside of an AC_DEFUN'd macro configure.ac:1: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -262,7 +262,7 @@ AT_SETUP([AC_USE_SYSTEM_EXTENSIONS]) _AT_CHECK_AC_MACRO( [[AC_AIX AC_DEFINE([__EXTENSIONS__], [1], [Manually defined for Solaris]) -]]) +]], [], [-Wno-obsolete]) _AT_CHECK_AC_MACRO( [[AC_USE_SYSTEM_EXTENSIONS diff --git a/tests/compile.at b/tests/compile.at index fbba8e63..c93722b9 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -344,7 +344,12 @@ test $estatus != 3 && AC_OUTPUT ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], 0, [], +[[configure.ac:14: warning: The macro `AC_TRY_RUN' is obsolete. +configure.ac:14: You should run autoupdate. +general.m4: AC_TRY_RUN is expanded from... +configure.ac:14: the top level +]]) AT_CHECK_CONFIGURE([-q]) AT_CLEANUP diff --git a/tests/local.at b/tests/local.at index a875b5e0..3424bd6a 100644 --- a/tests/local.at +++ b/tests/local.at @@ -137,6 +137,7 @@ m4_case([$4], [], [], [ignore], [], s/: C\(annot open \)\([^`:]*\):/: c\1`\2'\'':/ s/: include:\( cannot open\)/:\1/ s/^autom4te: [^ ]*m4[.ex]* /autom4te: m4 / + s/^autom4te: error: [^ ]*m4[.ex]* /autom4te: error: m4 / s!^.*/\([^/][^/]*\)\.m4: *[0-9][0-9]*: *!\1.m4: ! s!^.*/\([^/][^/]*\)\.m4: *[0-9][0-9]*: *[0-9][0-9]*: *!\1.m4: ! s/ (E[A-Z]*)$// @@ -508,39 +509,37 @@ dnl pacify editors that don't understand sh case: (( ]) -# _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS) +# _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS, [AUTOCONF-FLAGS]) # -------------------------------------- # Create a minimalist configure.ac running the macro named # NAME-OF-THE-MACRO, check that autoconf runs on that script, -# and that the shell runs correctly the configure. +# and that the generated configure script runs without error. m4_define([_AT_CHECK_AC_MACRO], [AT_CONFIGURE_AC([$1]) $2 -AT_CHECK_AUTOCONF -AT_CHECK_AUTOHEADER([], [ignore]) +AT_CHECK_AUTOCONF([$3]) +AT_CHECK_AUTOHEADER([$3], [ignore]) AT_CHECK_CONFIGURE AT_CHECK_ENV ])# _AT_CHECK_AC_MACRO # AT_CHECK_MACRO(MACRO, [MACRO-USE], [ADDITIONAL-CMDS], -# [AUTOCONF-FLAGS = -W obsolete]) +# [AUTOCONF-FLAGS]) # ----------------------------------------------------- # Create a minimalist configure.ac running the macro named # NAME-OF-THE-MACRO, check that autoconf runs on that script, -# and that the shell runs correctly the configure. +# and that the generated configure script runs without error. # # We run `configure' twice, both times with a cache, and compare # the environment after each run to detect inconsistencies. -# -# New macros are not expected to depend upon obsolete macros. m4_define([AT_CHECK_MACRO], [AT_SETUP([$1]) AT_CONFIGURE_AC([m4_default([$2], [$1])]) -AT_CHECK_AUTOCONF([m4_default([$4], [-W obsolete])]) -AT_CHECK_AUTOHEADER([], [ignore]) +AT_CHECK_AUTOCONF([$4]) +AT_CHECK_AUTOHEADER([$4], [ignore]) for at_run in r1 r2 do @@ -562,7 +561,7 @@ AT_CLEANUP[]dnl # AT_CHECK_MACRO_CROSS(MACRO, [MACRO-USE], [ADDITIONAL-CMDS], -# [AUTOCONF-FLAGS = -W obsolete]) +# [AUTOCONF-FLAGS]) # ----------------------------------------------------------- # Like the previous one, but creates two checks: for native # compile and for cross-compile. @@ -581,22 +580,29 @@ AT_CHECK_MACRO([$1 (cross compile)], # AT_CHECK_AU_MACRO(MACRO) # ------------------------ # Create a minimalist configure.ac running the macro named -# NAME-OF-THE-MACRO, autoupdate this script, check that autoconf runs -# on that script, and that the shell runs correctly the configure. -# -# Updated configure.ac shall not depend upon obsolete macros, which votes -# in favor of `-W obsolete', but since many of these macros leave a message -# to be removed by the user once her code is adjusted, let's not check. -# -# Remove config.hin to avoid `autoheader: config.hin is unchanged'. +# NAME-OF-THE-MACRO, check that autoconf runs on that script, +# and that the generated configure script runs without error. +# +# Then run autoupdate on that script, and check that NAME-OF-THE-MACRO +# no longer appears in configure.ac, autoconf runs on the updated +# script, the configure script still runs without error, and the +# result is unchanged. +# +# On the first pass, check for a -Wobsolete warning naming +# NAME-OF-THE-MACRO. On the second pass, *don't* check for the +# absence of -Wobsolete warnings, because many of autoupdate's edits +# leave the configure.ac author with some manual work to do, and +# indicate this by inserting an AC_DIAGNOSE message to be removed +# after the manual work is complete. m4_define([AT_CHECK_AU_MACRO], [AT_SETUP([$1]) AT_KEYWORDS([autoupdate]) AT_CONFIGURE_AC([$1]) -AT_CHECK_AUTOCONF -AT_CHECK_AUTOHEADER([], [ignore]) +AT_CHECK_AUTOCONF([], 0, [], [stderr]) +AT_CHECK([grep 'macro .$1. is obsolete' stderr], 0, [ignore], [ignore]) +AT_CHECK_AUTOHEADER([-Wno-obsolete], [ignore]) AT_CHECK_CONFIGURE AT_CHECK_ENV @@ -604,8 +610,8 @@ rm config.hin AT_CHECK_AUTOUPDATE([], 0, [], ignore) AT_CHECK([grep '^$1$' configure.ac], 1) -AT_CHECK_AUTOCONF -AT_CHECK_AUTOHEADER([], [ignore]) +AT_CHECK_AUTOCONF([-Wno-obsolete]) +AT_CHECK_AUTOHEADER([-Wno-obsolete], [ignore]) AT_CHECK_CONFIGURE AT_CHECK_ENV diff --git a/tests/m4sh.at b/tests/m4sh.at index b352704d..30e3fa58 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -599,7 +599,7 @@ ECHO_TEST([ AS_EXIT(0) ]]) -AT_CHECK_M4SH([-Wobsolete], 0, [], +AT_CHECK_M4SH([], 0, [], [[script.as:13: warning: $as@&t@_echo is obsolete; use AS@&t@_ECHO(["message"]) instead script.as:13: warning: $as@&t@_echo_n is obsolete; use AS@&t@_ECHO_N(["message"]) instead script.as:14: warning: $as@&t@_echo is obsolete; use AS@&t@_ECHO(["message"]) instead diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 3b861d55..aff83cfa 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -259,6 +259,7 @@ m4_warn([syntax], [syntax])dnl AT_CHECK_M4SUGAR([-o-], 0, [], [script.4s:4: warning: prefer named diversions +script.4s:5: warning: obsolete script.4s:7: warning: syntax script.4s:9: warning: syntax ]) @@ -354,7 +355,7 @@ AT_DATA_M4SUGAR([script.4s], AT_CHECK_M4SUGAR([-o-], [1], [], [[script.4s:1: error: too many m4@&t@_divert_pop script.4s:1: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_DATA_M4SUGAR([script.4s], @@ -367,7 +368,7 @@ AT_CHECK_M4SUGAR([-o-], [1], [], script.4s:2: m4@&t@_divert_push: 1 script.4s:1: m4@&t@_divert: KILL script.4s:3: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_DATA_M4SUGAR([script.4s], @@ -380,7 +381,7 @@ AT_CHECK_M4SUGAR([-o-], [1], [], script.4s:3: m4@&t@_divert_push: 2 script.4s:2: m4@&t@_divert: KILL script.4s:2: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -425,7 +426,7 @@ m4_require([foo]) AT_CHECK_M4SUGAR([], 1, [], [[script.4s:2: error: m4@&t@_require(foo): cannot be used outside of an m4_defun'd macro script.4s:2: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -506,7 +507,7 @@ script.4s:3: bar is expanded from... script.4s:1: foo is expanded from... script.4s:5: baz is expanded from... script.4s:9: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -923,7 +924,7 @@ m4_argn([0], [a], [b], [c]) AT_CHECK_M4SUGAR([-o-], [1], [], [[script.4s:2: error: assert failed: 0 < 0 script.4s:2: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -1605,7 +1606,7 @@ m4_for([myvar], 1, 3,-1, [ myvar]) AT_CHECK_M4SUGAR([], 1, [], [[script.4s:3: error: assert failed: -1 > 0 script.4s:3: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_DATA_M4SUGAR([script.4s], @@ -1616,7 +1617,7 @@ m4_for([myvar], 1, 2, 0, [ myvar]) AT_CHECK_M4SUGAR([], 1, [], [[script.4s:3: error: assert failed: 0 > 0 script.4s:3: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_DATA_M4SUGAR([script.4s], @@ -1627,7 +1628,7 @@ m4_for([myvar], 2, 1, 0, [ myvar]) AT_CHECK_M4SUGAR([], 1, [], [[script.4s:3: error: assert failed: 0 < 0 script.4s:3: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) dnl m4_shiftn also does bounds checking @@ -1639,7 +1640,7 @@ m4_shiftn(3,1,2) AT_CHECK_M4SUGAR([], 1, [], [[script.4s:3: error: assert failed: 0 < 3 && 3 < 3 script.4s:3: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CLEANUP @@ -1832,7 +1833,7 @@ AT_DATA_M4SUGAR([script.4s], AT_CHECK_M4SUGAR([], 1, [], [[script.4s:1: error: too few arguments to m4@&t@_max script.4s:1: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_DATA_M4SUGAR([script.4s], @@ -1842,7 +1843,7 @@ AT_DATA_M4SUGAR([script.4s], AT_CHECK_M4SUGAR([], 1, [], [[script.4s:1: error: too few arguments to m4@&t@_min script.4s:1: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) AT_CHECK_M4SUGAR_TEXT([[dnl diff --git a/tests/semantics.at b/tests/semantics.at index 32811f6d..e7dd7c5a 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -251,7 +251,7 @@ AT_DATA([autoconf_io.h], ]) AT_CONFIGURE_AC([AC_CHECK_HEADERS(stdio.h autoconf_io.h)]) -AT_CHECK_AUTOCONF([-W obsolete]) +AT_CHECK_AUTOCONF AT_CHECK_AUTOHEADER([], [ HAVE_AUTOCONF_IO_H HAVE_INTTYPES_H @@ -291,7 +291,7 @@ AT_DATA([header2.h], AT_CONFIGURE_AC([[AC_CHECK_HEADERS([header2.h], [], [], [-])]]) -AT_CHECK_AUTOCONF([-W obsolete], [], [], +AT_CHECK_AUTOCONF([], 0, [], [[configure.ac:4: warning: Checking for headers with the preprocessor is configure.ac:4: deprecated. Specify prerequisite code to AC_CHECK_HEADER configure.ac:4: instead of using fourth argument `-'. (Many headers need @@ -303,7 +303,7 @@ headers.m4: AC_CHECK_HEADER is expanded from... headers.m4: AC_CHECK_HEADERS is expanded from... configure.ac:4: the top level ]]) -AT_CHECK_AUTOHEADER([], [HAVE_HEADER2_H]) +AT_CHECK_AUTOHEADER([-W no-obsolete], [HAVE_HEADER2_H]) AT_CHECK_CONFIGURE([CPPFLAGS=-I.]) AT_CHECK_ENV AT_CHECK_DEFINES( @@ -334,7 +334,7 @@ AT_DATA([header3.h], AT_CONFIGURE_AC( [AC_CHECK_HEADERS(header2.h header3.h, [], [], [[@%:@include "header1.h"]])]) -AT_CHECK_AUTOCONF([-W obsolete]) +AT_CHECK_AUTOCONF AT_CHECK_AUTOHEADER([], [ HAVE_HEADER2_H HAVE_HEADER3_H @@ -829,14 +829,14 @@ $1([dn@&t@l fn_blurf dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:6: warning: whitespace-separated list contains macros; configure.ac:6: in a future version of Autoconf they will not be expanded configure.ac:6: note: `dn@&t@l' is a macro functions.m4: $1 is expanded from... configure.ac:6: the top level ]) -AT_CHECK_AUTOHEADER([], [ +AT_CHECK_AUTOHEADER([-W no-obsolete], [ HAVE_FN_BLURF HAVE_FN_FOO HAVE_FN_NOCOMMENT @@ -858,7 +858,7 @@ $1([dn@&t@l fn_blurf dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:8: warning: whitespace-separated list contains macros; configure.ac:8: in a future version of Autoconf they will not be expanded configure.ac:8: note: `dn@&t@l' is a macro @@ -868,7 +868,7 @@ configure.ac:8: warning: $1($fns): you should use literals functions.m4: $1 is expanded from... configure.ac:8: the top level ]) -AT_CHECK_AUTOHEADER([], [ +AT_CHECK_AUTOHEADER([-W no-obsolete], [ HAVE_FN_BLURF HAVE_FN_FOO HAVE_FN_NOCOMMENT @@ -894,14 +894,14 @@ $1([dn@&t@l blurf.h dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:6: warning: whitespace-separated list contains macros; configure.ac:6: in a future version of Autoconf they will not be expanded configure.ac:6: note: `dn@&t@l' is a macro headers.m4: $1 is expanded from... configure.ac:6: the top level ]) -AT_CHECK_AUTOHEADER([], [ +AT_CHECK_AUTOHEADER([-W no-obsolete], [ HAVE_BLURF_H HAVE_FOO_H HAVE_INTTYPES_H @@ -932,7 +932,7 @@ $1([dn@&t@l blurf.h dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:8: warning: whitespace-separated list contains macros; configure.ac:8: in a future version of Autoconf they will not be expanded configure.ac:8: note: `dn@&t@l' is a macro @@ -942,7 +942,7 @@ configure.ac:8: warning: $1($hs): you should use literals headers.m4: $1 is expanded from... configure.ac:8: the top level ]) -AT_CHECK_AUTOHEADER([], [ +AT_CHECK_AUTOHEADER([-W no-obsolete], [ HAVE_BLURF_H HAVE_FOO_H HAVE_INTTYPES_H @@ -982,14 +982,14 @@ AC_CHECK_FILES([dn@&t@l /nonex/f_blurf dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:6: warning: whitespace-separated list contains macros; configure.ac:6: in a future version of Autoconf they will not be expanded configure.ac:6: note: `dn@&t@l' is a macro general.m4: AC_CHECK_FILES is expanded from... configure.ac:6: the top level ]) -AT_CHECK_AUTOHEADER([], [ +AT_CHECK_AUTOHEADER([-W no-obsolete], [ HAVE__NONEX_F_BLURF HAVE__NONEX_F_FOO HAVE__NONEX_F_QUUX @@ -1008,7 +1008,7 @@ AC_CONFIG_MACRO_DIRS([dn@&t@l d_blurf dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete -t AC_CONFIG_MACRO_DIR_TRACE], [0], +AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR_TRACE], [0], [configure.ac:6:AC_CONFIG_MACRO_DIR_TRACE:d_foo configure.ac:6:AC_CONFIG_MACRO_DIR_TRACE:d_quux configure.ac:6:AC_CONFIG_MACRO_DIR_TRACE:d_blurf @@ -1040,14 +1040,14 @@ AC_CONFIG_SUBDIRS([dn@&t@l d_blurf dn@&t@l Apos'trophed comment ]) ]]) -AT_CHECK_AUTOCONF([-W obsolete], [0], [], +AT_CHECK_AUTOCONF([], [0], [], [configure.ac:6: warning: whitespace-separated list contains macros; configure.ac:6: in a future version of Autoconf they will not be expanded configure.ac:6: note: `dn@&t@l' is a macro status.m4: AC_CONFIG_SUBDIRS is expanded from... configure.ac:6: the top level ]) -AT_CHECK_AUTOHEADER +AT_CHECK_AUTOHEADER([-W no-obsolete]) AT_CHECK_CONFIGURE([], [0], [stdout]) AT_CHECK([grep '^entered' stdout], [0], [[entered d_foo/configure diff --git a/tests/tools.at b/tests/tools.at index 3093225c..1bb670fa 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -100,7 +100,7 @@ mkdir sub mv foo sub AT_CHECK_M4SUGAR([], [1], [], [m4:script.4s:1: cannot open `foo': No such file or directory -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]) # But if we change the main file, then we should no longer complain of @@ -414,7 +414,7 @@ AC_CONFIG_MACRO_DIR_TRACE([dir1]) AT_CHECK_AUTOCONF([], [1], [], [[configure.ac:2: error: Do not invoke AC_CONFIG_MACRO_DIR_TRACE directly configure.ac:2: the top level -autom4te: m4 failed with exit status: 1 +autom4te: error: m4 failed with exit status: 1 ]]) # Legacy macro use is not required, but still gets traced @@ -952,7 +952,17 @@ AT_DATA([dst2], dst2 # Checking `autoupdate'. AT_CHECK_AUTOUPDATE([], 0, [], ignore) -AT_CHECK_AUTOCONF + +# The replacement for AC_LINK_FILES includes a forced -Wobsolete +# warning, becuause it needs to be manually adjusted afterward. +# Look for it in the autoconf output. +AT_CHECK_AUTOCONF([], 0, [], stderr) +AT_CHECK([grep 'AC_LINK_FILES' stderr], 0, ignore, ignore) +AT_CHECK([grep 'AC_CONFIG_LINKS' stderr], 0, ignore, ignore) +AT_CHECK([grep 'warning: It is technically impossible' stderr], + 0, ignore, ignore) +AT_CHECK([grep 'tune the result yourself' stderr], 0, ignore, ignore) + AT_CHECK_CONFIGURE AT_CHECK([cat src1], 0, [dst1 ]) @@ -994,12 +1004,37 @@ AU_ALIAS([BAZ],[FOO]) test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1 AC_PROG_CC AC_WORDS_BIGENDIAN +AC_CONFIG_HEADERS([config.h]) AC_OUTPUT ]]) # Checking `autoupdate'. AT_CHECK_AUTOUPDATE -AT_CHECK_AUTOCONF + +# autoupdate does not replace AU_DEFUNs/AU_ALIASes defined by +# configure.ac itself, nor by aclocal.m4, so BAZ will still be present +# in the updated configure.ac. This is actually desirable for this +# test: the point of that part of the above configure.ac is to to +# verify that the expansion of an AU_ALIAS definition handles $# +# correctly. If BAZ got turned into FOO by the above call to +# autoupdate, we would need to run autoconf and configure twice in +# this test. However, it does also mean that by default we get a +# -Wobsolete warning because of BAZ, so turn that off so it doesn't +# cause a spurious failure. +AT_CHECK_AUTOCONF([-Wno-obsolete]) +AT_CHECK_AUTOHEADER([-Wno-obsolete], [ + AC_APPLE_UNIVERSAL_BUILD + HAVE_INTTYPES_H + HAVE_STDINT_H + HAVE_STDLIB_H + HAVE_STRINGS_H + HAVE_STRING_H + HAVE_SYS_STAT_H + HAVE_SYS_TYPES_H + HAVE_UNISTD_H + STDC_HEADERS + WORDS_BIGENDIAN +]) AT_CHECK_CONFIGURE AT_CHECK([grep 'AC_C_BIGENDIAN[(]' configure.ac], 1, [ignore], [ignore]) AT_CHECK([grep 'AC_C_BIGENDIAN' configure.ac], 0, [ignore], [ignore]) @@ -1208,9 +1243,16 @@ AC_OUTPUT ]]) # Checking `autoupdate'. + +# Both the autoupdate and autoconf invocations will complain about +# AC_LANG_SAVE being obsolete, because autoupdate cannot replace +# two-macro sequences (e.g. AC_LANG_SAVE \n AC_LANG([C]) ideally would +# become AC_LANG_PUSH([C]) but we can't do that) so an AC_DIAGNOSE +# is left in place to remind people they need to do some hand edits. +# Ignore these diagnostics. AT_CHECK_AUTOUPDATE([], [], [], [ignore]) -AT_CHECK_AUTOCONF -AT_CHECK_CONFIGURE([], [], [], [ignore]) +AT_CHECK_AUTOCONF([], [], [], [ignore]) +AT_CHECK_CONFIGURE AT_CLEANUP diff --git a/tests/torture.at b/tests/torture.at index 53859f6b..5c61027c 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -149,7 +149,10 @@ AT_DATA([file.in], [[`@precious@' ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], 0, [], +[[configure.ac:4: warning: AC_OUTPUT should be used without arguments. +configure.ac:4: You should run autoupdate. +]]) # Set a precious variable AT_CHECK_AC_ARG_VAR([], [apple of my eye]) |