diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/base.at | 33 | ||||
-rw-r--r-- | tests/c.at | 1 | ||||
-rw-r--r-- | tests/compile.at | 26 | ||||
-rw-r--r-- | tests/m4sh.at | 5 | ||||
-rw-r--r-- | tests/semantics.at | 12 | ||||
-rw-r--r-- | tests/tools.at | 28 | ||||
-rw-r--r-- | tests/torture.at | 13 | ||||
-rw-r--r-- | tests/wrapper.as | 3 |
8 files changed, 93 insertions, 28 deletions
diff --git a/tests/base.at b/tests/base.at index 98125173..4042a8aa 100644 --- a/tests/base.at +++ b/tests/base.at @@ -57,7 +57,10 @@ test -z "$test1" && AS_EXIT(0) ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], [0], [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CHECK_CONFIGURE AT_CLEANUP @@ -117,7 +120,10 @@ case $multi_test:$single_test in esac ]]) -AT_CHECK_AUTOCONF([], 0, []) +AT_CHECK_AUTOCONF([], 0, [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CHECK_CONFIGURE @@ -160,7 +166,10 @@ case $multi_test:$single_test in esac ]]) -AT_CHECK_AUTOCONF([], 0, []) +AT_CHECK_AUTOCONF([], 0, [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CHECK_CONFIGURE AT_CLEANUP @@ -192,7 +201,10 @@ case $inner_test in esac ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], 0, [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CHECK_CONFIGURE AT_CLEANUP @@ -208,6 +220,7 @@ AT_SETUP([AC_INIT]) AT_DATA([configure.ac], [[AC_INIT([GNU fu], [1.0], [bug-fu@gnu.org]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -354,6 +367,7 @@ words that may be matched by scanners for legal things, causing extra work for distributors. Multi-line values should be supported. ]]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -403,8 +417,7 @@ if ${my_cv_variable+false} :; then AC_MSG_ERROR([AC@&@&t@t@_CACHE_VAL did not ensure that the cache variable was set]) fi -# AC_CACHE_SAVE should be enough here, no need for AC_OUTPUT. -AC_CACHE_SAVE +AC_OUTPUT ]]) AT_CHECK_AUTOCONF([], [], [], [stderr]) @@ -603,6 +616,7 @@ AC_COMPUTE_INT([invalid_expression], [invalid_expression=failed]) test "$invalid_expression" = failed || AC_MSG_ERROR([**0** evaluated to $invalid_expression instead of failing]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -633,6 +647,8 @@ if AC_TRY_COMMAND([(echo "The Cat in the Hat"; grep \^The\ Hat\ in\ the\ Cat\$ >/dev/null]); then AC_MSG_ERROR([saw the Hat in the Cat]) fi + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -650,9 +666,10 @@ AT_SETUP([Input/Output]) AT_DATA([configure.ac], [[AC_INIT cat <&AS@&t@_ORIGINAL_STDIN_FD >&AS@&t@_MESSAGE_FD +AC_OUTPUT ]]) AT_CHECK_AUTOCONF -AT_CHECK([echo Hello | CONFIG_SITE=/dev/null ./configure $configure_options | grep -v 'configure: loading site script '],, [Hello +AT_CHECK([echo Hello | CONFIG_SITE=/dev/null ./configure $configure_options | grep -v '^configure: '],, [Hello ]) AT_CHECK([echo Hello | CONFIG_SITE=/dev/null ./configure $configure_options --silent]) @@ -668,6 +685,7 @@ AT_SETUP([configure arguments]) AT_DATA([configure.ac], [[AC_INIT echo "$@" +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -706,6 +724,7 @@ AC_ARG_ENABLE([c++], echo "use_foo: $use_foo" echo "with_c++: $with_c__, $choice_with" echo "enable_c++: $enable_c__, $choice_enable" +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -60,6 +60,7 @@ AT_DATA([configure.ac], [[AC_INIT CC=no-such-compiler AC_PROG_CC +AC_OUTPUT ]]) AT_CHECK_AUTOCONF diff --git a/tests/compile.at b/tests/compile.at index 5d75ada8..fbba8e63 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -55,6 +55,7 @@ AC_LANG_POP([C++]) # C C AC_LANG_POP([C]) # C +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -106,7 +107,10 @@ AC_F77_2 AS_EXIT(0) ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], [0], [], +[[trailer.m4: warning: AC_OUTPUT was never used +]]) + AT_CHECK_CONFIGURE AT_CLEANUP @@ -129,6 +133,7 @@ int main (void) return 0; } ]], [], [AC_MSG_FAILURE([confdefs not included])])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -155,6 +160,7 @@ int main (void) return 0; } ]], [], [AC_MSG_FAILURE([confdefs not included])])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -185,6 +191,7 @@ AC_LANG([C]) AC_LANG_CONFTEST( [AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])]) gcc -E -dD conftest.c || AS_EXIT([77]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -193,7 +200,7 @@ AT_CHECK_CONFIGURE([], [], [stdout]) # Note that the output may contain more defines and lines matching # # 1 "conftest.c" # so delete everything before the interesting output. -AT_CHECK([sed -n 's/ *$//; /#define PACKAGE/,$p' stdout], [], +AT_CHECK([sed -n 's/ *$//; /^configure: /d; /#define PACKAGE/,$p' stdout], [], [[#define PACKAGE_NAME "Hello" #define PACKAGE_TARNAME "hello" #define PACKAGE_VERSION "1.0" @@ -230,6 +237,7 @@ AC_LANG_CONFTEST( [AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]], [[fputs (hw, stdout);]])]) gcc -E -dD conftest.c || AS_EXIT([77]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -238,7 +246,7 @@ AT_CHECK_CONFIGURE([], [], [stdout]) # Note that the output may contain more defines and lines matching # # 1 "conftest.c" # so delete everything before the interesting output. -AT_CHECK([sed -n 's/ *$//; /#define PACKAGE/,$p' stdout], [], +AT_CHECK([sed -n 's/ *$//; /^configure: /d; /#define PACKAGE/,$p' stdout], [], [[#define PACKAGE_NAME "Hello" #define PACKAGE_TARNAME "hello" #define PACKAGE_VERSION "1.0" @@ -271,6 +279,7 @@ AT_DATA([configure.ac], [[AC_INIT AC_COMPILE_IFELSE([int main (void) { return 0; }], [], [AC_MSG_ERROR([compiling trivial program failed])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF([], [], [], [stderr]) @@ -282,6 +291,7 @@ AT_DATA([configure.ac], [[AC_INIT AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED()int main (void) { return 0; }], [], [AC_MSG_ERROR([compiling trivial program failed])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -296,6 +306,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 2])], [], [AC_MSG_ERROR([compiling `return 2' failed])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -330,6 +341,7 @@ AC_TRY_RUN([int main (void) { return 3; }], test $estatus != 3 && AC_MSG_ERROR([did not get 3 as exit status: $estatus])]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -375,6 +387,8 @@ d@&t@nl conftest.err not generated by AC_RUN_IFELSE? AC_RUN_IFELSE([AC_LANG_PROGRAM([int bad bad;], [])], [AS_EXIT([1])], []) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -410,6 +424,8 @@ AC_COMPILE_IFELSE([ choke me #endif ]])], [], AS_EXIT([77])) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -428,6 +444,8 @@ AC_COMPILE_IFELSE([ #endif ]])], [], AS_EXIT([77])) AC_LANG_POP([C++]) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -457,6 +475,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([class A {};], [])], AC_CHECK_HEADER([cstring]) AC_LANG_POP([C++]) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF diff --git a/tests/m4sh.at b/tests/m4sh.at index a18277ac..b352704d 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -112,6 +112,7 @@ AT_SETUP([Configure re-execs self with CONFIG_SHELL]) AT_DATA([configure.ac], [[AC_INIT echo foobar >> quux +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -127,7 +128,9 @@ AT_CAPTURE_FILE([config.log]) # Export CONFIG_SITE to /dev/null to avoid spurious diffs in expected # stdout/stderr. AT_CHECK([env CONFIG_SITE=/dev/null CONFIG_SHELL=./cfg-sh ./configure], - [0], [], []) + [0], +[[configure: creating ./config.status +]], []) # ./configure re-executed itself. AT_CHECK([test -f cfg-sh-has-run], [0]) # And did that not to cause extra execution of later commands. diff --git a/tests/semantics.at b/tests/semantics.at index f10a0b53..98933aa1 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -589,10 +589,10 @@ test -z "$TOOL5" || fail=: AC_CHECK_PROGS(TOOL6, missing tool better,, $path) test "$TOOL6" = tool || fail=: -# No AC-OUTPUT, we don't need config.status. $fail && AC_MSG_ERROR([[CHECK_PROG failed]]) -AS_EXIT(0) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -692,10 +692,10 @@ test -z "$TOOL3" || fail=: AC_PATH_PROGS(TOOL4, missing tool better,, $path) test "$TOOL4" = "$pwd/path/1/tool" || fail=: -# No AC-OUTPUT, we don't need config.status. $fail && AC_MSG_ERROR([[PATH_PROG failed]]) -AS_EXIT(0) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF @@ -770,10 +770,10 @@ AC_PATH_PROGS_FEATURE_CHECK(TOOL7, [tool better], test -z "$TOOL7" || fail=: test "$ac_cv_path_TOOL7" = "$pwd/path/1/tool" || fail=: -# No AC-OUTPUT, we don't need config.status. $fail && AC_MSG_ERROR([[PATH_PROG failed]]) -AS_EXIT(0) + +AC_OUTPUT ]]) AT_CHECK_AUTOCONF diff --git a/tests/tools.at b/tests/tools.at index 314462ff..3093225c 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -390,6 +390,7 @@ AT_DATA([configure.ac], [[AC_INIT AC_CONFIG_MACRO_DIR([dir1]) AC_CONFIG_MACRO_DIR([dir2]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF([], [1], [], [stderr]) AT_CHECK([grep 'error: AC_CONFIG_MACRO_DIR can only be used once' stderr], @@ -421,6 +422,7 @@ AT_DATA([configure.ac], [[AC_INIT AC_CONFIG_MACRO_DIRS([dir1]) AC_CONFIG_MACRO_DIRS([dir2]) +AC_OUTPUT ]]) AT_CHECK_AUTOCONF([], [0], [], []) AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR], [0], @@ -459,7 +461,9 @@ end-language: "Autoconf-without-aclocal-m4" ]]) AT_CHECK_AUTOCONF([], 1, [], -[[configure.ac:2: error: possibly undefined macro: m4@&t@_foo +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +configure.ac:2: error: possibly undefined macro: m4@&t@_foo If this token and others are legitimate, please use m4@&t@_pattern_allow. See the Autoconf documentation. configure.ac:3: error: possibly undefined macro: _m4@&t@_bar @@ -467,8 +471,12 @@ configure.ac:4: error: possibly undefined macro: AS@&t@_FOO configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR configure.ac:6: error: possibly undefined macro: d@&t@nl ]]) -# Second run should succeed and yield no output. -AT_CHECK([autoconf]) +# A second run (without --force) should succeed and yield only the +# warnings about AC_INIT and AC_OUTPUT. +AT_CHECK_M4([autoconf], 0, [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CLEANUP @@ -500,7 +508,9 @@ It would be very bad if Autoconf forgot to expand [AS_]INIT! ]]) AT_CHECK_AUTOCONF([], 1, [], -[[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +configure.ac:1: error: possibly undefined macro: AS@&t@_INIT If this token and others are legitimate, please use m4@&t@_pattern_allow. See the Autoconf documentation. configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT @@ -539,7 +549,10 @@ m4_divert([])dnl line that begins with a space ]]) -AT_CHECK_AUTOCONF +AT_CHECK_AUTOCONF([], 0, [], +[[trailer.m4: warning: AC_INIT was never used +trailer.m4: warning: AC_OUTPUT was never used +]]) AT_CLEANUP @@ -1009,6 +1022,7 @@ AT_DATA([configure.ac], [[AC_INIT OLD(1, 2) NEW([0, 0], [0]) +AC_OUTPUT ]]) # Checking `autoupdate'. @@ -1053,6 +1067,7 @@ AT_SETUP([autoupdating AC_HELP_STRING]) AT_DATA([configure.ac], [[AC_INIT AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:]) +AC_OUTPUT ]]) # Checking `autoupdate'. @@ -1189,6 +1204,7 @@ AC_LANG_SAVE AC_LANG_RESTORE AC_LANG_SAVE AC_LANG_RESTORE +AC_OUTPUT ]]) # Checking `autoupdate'. @@ -1210,6 +1226,7 @@ AT_DATA([aclocal.m4], AT_DATA([configure.ac], [[AC_INIT echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD +AC_OUTPUT ]]) # Checking `autoupdate'. @@ -1318,6 +1335,7 @@ chmod a-w sub AT_DATA([configure.ac], [[AC_INIT +AC_OUTPUT ]]) AT_DATA([.autom4te.cfg], diff --git a/tests/torture.at b/tests/torture.at index b50dfebc..37deef25 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1037,12 +1037,12 @@ two], [This spans two lines.]) AT_CHECK_AUTOCONF([], [], [], [stderr]) dnl Older versions of m4 report error at line 5 (end of macro); dnl newer versions report it at line 4 (start of macro). -AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [], +AT_CHECK([[sed '/trailer\.m4:/d; s/^configure\.ac:[45]: //' stderr]], [], [[warning: AC_DEFINE: `one two' is not a valid preprocessor define value ]]) AT_CHECK_AUTOHEADER([], [foo], [], [], [stderr]) -AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [], +AT_CHECK([[sed 's/^configure\.ac:[45]: //' stderr]], [], [[warning: AC_DEFINE: `one two' is not a valid preprocessor define value ]]) @@ -1050,16 +1050,18 @@ AT_CHECK_CONFIGURE AT_CHECK_DEFINES([[#define foo one ]]) +rm -rf autom4te.cache + AT_CONFIGURE_AC([[AC_DEFINE_UNQUOTED([foo], [one two], [This spans two lines.]) ]]) AT_CHECK_AUTOCONF([], [], [], [stderr]) -AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [], +AT_CHECK([[sed '/trailer.m4:/d; s/^configure\.ac:[45]: //' stderr]], [], [[warning: AC_DEFINE_UNQUOTED: `one two' is not a valid preprocessor define value ]]) AT_CHECK_AUTOHEADER([], [foo], [], [], [stderr]) -AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [], +AT_CHECK([[sed 's/^configure\.ac:[45]: //' stderr]], [], [[warning: AC_DEFINE_UNQUOTED: `one two' is not a valid preprocessor define value ]]) @@ -1290,10 +1292,11 @@ AT_DATA([configure.ac], [[AC_INIT kill -2 $$ exit 77 +AC_OUTPUT ]]) AT_CHECK_AUTOCONF -AT_CHECK_CONFIGURE([], 1, ignore, ignore) +AT_CHECK_CONFIGURE([], [1], [ignore], [ignore]) AT_CLEANUP diff --git a/tests/wrapper.as b/tests/wrapper.as index 8f77053e..f0a5c037 100644 --- a/tests/wrapper.as +++ b/tests/wrapper.as @@ -24,7 +24,8 @@ AUTOHEADER=autoheader AUTOM4TE=autom4te AUTOM4TE_CFG='@abs_top_builddir@/lib/autom4te.cfg' autom4te_perllibdir='@abs_top_srcdir@/lib' -export AUTOCONF AUTOHEADER AUTOM4TE AUTOM4TE_CFG autom4te_perllibdir +trailer_m4='@abs_top_srcdir@/lib/autoconf/trailer.m4' +export AUTOCONF AUTOHEADER AUTOM4TE AUTOM4TE_CFG autom4te_perllibdir trailer_m4 case '@wrap_program@' in ifnames) |