]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/atgeneral.m4 (AT_CHECK): Make exit status report more
authorAkim Demaille <akim@epita.fr>
Tue, 19 Dec 2000 08:15:48 +0000 (08:15 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 19 Dec 2000 08:15:48 +0000 (08:15 +0000)
visible.
* tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT
and STDERR.
(AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed.
Spread their use in the whole suite.
Simplify a few AT_CLEANUPs.

ChangeLog
lib/autotest/general.m4
tests/atgeneral.m4
tests/atspecific.m4
tests/base.at
tests/compile.at
tests/m4sh.at
tests/m4sugar.at
tests/semantics.at
tests/tools.at
tests/torture.at

index ca68c1bc85ab8e148542d9bad3815b73e613dc84..9d00ddff7065a2cc40c631d5e7ef70c792cdf29e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-12-19  Akim Demaille  <akim@epita.fr>
+
+       * tests/atgeneral.m4 (AT_CHECK): Make exit status report more
+       visible.
+       * tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT
+       and STDERR.
+       (AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed.
+       Spread their use in the whole suite.
+       Simplify a few AT_CLEANUPs.
+
 2000-12-19  Akim Demaille  <akim@epita.fr>
 
        * tests/atgeneral.m4 (AT_CHECK): Accept if-failed and
index 3cdc385c02e6e7b7bc2207db24cc16234c970d19..0053900bc70df8eff07b196168298b1d0d6efe68 100644 (file)
@@ -455,7 +455,7 @@ m4_case([$2],
   [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) $at_verbose "Exit code was $at_status, expected $2" >&2
+   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
       at_failed=:;;])
 esac
 AS_IFELSE($at_failed, [$5], [$6])
index 3cdc385c02e6e7b7bc2207db24cc16234c970d19..0053900bc70df8eff07b196168298b1d0d6efe68 100644 (file)
@@ -455,7 +455,7 @@ m4_case([$2],
   [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) $at_verbose "Exit code was $at_status, expected $2" >&2
+   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
       at_failed=:;;])
 esac
 AS_IFELSE($at_failed, [$5], [$6])
index 22f04d43732534cc555678589a7514926889922d..8f77243bf77bab56ce49931f251bd4247ef75f5c 100644 (file)
@@ -22,11 +22,11 @@ include(atgeneral.m4)                                       -*- Autoconf -*-
 ## ---------------------------------------- ##
 
 
-# AT_CHECK_AUTOCONF
-# -----------------
+# AT_CHECK_AUTOCONF(FLAGS, STDOUT, STDERR)
+# ----------------------------------------
 m4_define([AT_CHECK_AUTOCONF],
 [AT_CLEANUP_FILES(configure)dnl
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])])
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir $1], 0, [$2], [$3])])
 
 
 # AT_CHECK_AUTOHEADER
@@ -36,16 +36,20 @@ m4_define([AT_CHECK_AUTOHEADER],
 AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])])
 
 
-# AT_CHECK_CONFIGURE
-# ------------------
+# AT_CHECK_CONFIGURE(END-COMMAND,
+#                    [EXIT-STATUS = 0],
+#                    [SDOUT = IGNORE], STDERR)
+# --------------------------------------------
 # `top_srcdir' is needed so that `./configure' finds install-sh.
 # Using --srcdir is more expensive.
 m4_define([AT_CHECK_CONFIGURE],
-[AT_CLEANUP_FILE_IFELSE([config.hin],
-                        [AT_CLEANUP_FILE(config.h)])dnl
+[AT_CLEANUP_FILE_IFELSE([config.hin], [AT_CLEANUP_FILE(config.h)])dnl
+AT_CLEANUP_FILE_IFELSE([defs.in], [AT_CLEANUP_FILE(defs)])dnl
 AT_CLEANUP_FILES(config.log config.status config.cache)dnl
-AT_CHECK([top_srcdir=$top_srcdir ./configure], 0, ignore, [],
-        [test $at_verbose = echo && echo "--- config.log" && cat config.log])])
+AT_CHECK([top_srcdir=$top_srcdir ./configure $1],
+         [$2],
+         m4_default([$3], [ignore]), [$4],
+         [test $at_verbose = echo && echo "$srcdir/AT_LINE: config.log" && cat config.log])])
 
 
 # _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS)
index 16e74040785ab3d17a960ecdf7e60f01073bf407..706701bacbfb2d024b7b1957d86f346433e7cc42 100644 (file)
@@ -40,9 +40,9 @@ AS_EXIT(0)
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
 
-AT_CLEANUP(configure)
+AT_CLEANUP
 
 
 
@@ -78,14 +78,14 @@ case $multi_test:$single_test in
 esac
 ]])
 
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
+AT_CHECK_AUTOCONF([], [],
 [configure.in:16: warning: SINGLE_TEST invoked multiple times
 configure.in:17: warning: SINGLE_TEST invoked multiple times
 ])
 
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
 
-AT_CLEANUP(configure)
+AT_CLEANUP
 
 
 
@@ -122,13 +122,12 @@ case $multi_test:$single_test in
 esac
 ]])
 
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
+AT_CHECK_AUTOCONF([], [],
 [configure.in:15: warning: SINGLE_TEST invoked multiple times
 ])
-AT_CHECK([./configure], 0)
-
+AT_CHECK_CONFIGURE
 
-AT_CLEANUP(configure)
+AT_CLEANUP
 
 
 
@@ -155,8 +154,7 @@ case $inner_test in
 esac
 ]])
 
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
-AT_CHECK([./configure], 0)
-
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
 
 AT_CLEANUP(configure)
index ddd377dfec42cbe94ae4d65d581c0346529c11b8..93c00cf3aec37d6691c51beddbe32535c13d7549 100644 (file)
@@ -67,7 +67,7 @@ AT_CHECK_DEFINES(
 #define HAVE_STDIO_H 1
 ])
 
-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+AT_CLEANUP
 
 
 ## ------------------------------ ##
@@ -99,7 +99,7 @@ AT_CHECK_DEFINES(
 #define HAVE_STDIO_H 1
 ])
 
-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+AT_CLEANUP
 
 
 
index 8eccd2597044e838764de97dc001cc7eebc54498..975f79ddfab26f16bc3953f753f0d304b763194b 100644 (file)
@@ -48,7 +48,7 @@ AS_EXIT(0)
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
 
 AT_CLEANUP(configure)
 
@@ -78,7 +78,7 @@ AS_EXIT(0)
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
 
 AT_CLEANUP(configure 1 a)
 
@@ -107,6 +107,6 @@ esac
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
 
 AT_CLEANUP(configure)
index 560b4730ce16c37716ecf5802e9e01b798df640c..1411df23fb4df327dd98b1dbce00a4755dfa30bb 100644 (file)
@@ -12,7 +12,7 @@ AT_SETUP([[m4_text_wrap]])
 # commas are not swallowed.  This can easily happen because of
 # m4-listification.
 
-AT_DATA(configure.in,
+AT_DATA([configure.in],
 [[AC_PLAIN_SCRIPT()dnl
 m4_text_wrap([Short string */], [   ], [/* ], 20)
 
@@ -45,9 +45,9 @@ AT_DATA(expout,
 First, second , third, [,quoted]
 ]])
 
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+AT_CHECK_AUTOCONF([-o-], [expout])
 
-AT_CLEANUP()
+AT_CLEANUP
 
 
 
@@ -90,4 +90,4 @@ AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o- -Wnone,bar,error],
 configure.in:2: the top level
 ])
 
-AT_CLEANUP()
+AT_CLEANUP
index 6f9eeb2256389e0a0f5040f859cf49713d5a7da4..cb769cd1e6da3108288b76925d7e61d816ebea4c 100644 (file)
@@ -151,7 +151,7 @@ AC_CHECK_TYPE(a,b,c,d)
 AC_OUTPUT
 ]])
 
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0,,
+AT_CHECK_AUTOCONF([], [],
 [configure.in:10: warning: AC_CHECK_TYPE: assuming `uint65536_t' is not a type
 ])
 AT_CHECK([[sed -e '/^#(cut-from-here/,/^#to-here)/!d' -e '/^#/d' configure]],
@@ -164,7 +164,7 @@ NEW
 NEW
 ])
 
-AT_CLEANUP(autoconf.err)
+AT_CLEANUP
 
 
 
@@ -310,7 +310,7 @@ AT_SETUP([AC_PATH_XTRA])
 _AT_CHECK_AC_MACRO([AC_PATH_XTRA])
 
 # Check X_DISPLAY_MISSING.
-AT_CHECK([top_srcdir=$top_srcdir ./configure --without-x], 0, ignore)
+AT_CHECK_CONFIGURE([--without-x])
 AT_CHECK_DEFINES(
 [#define X_DISPLAY_MISSING 1
 ])
index ee546a8ef892856e6ba88b81753dbcdc7fcbebd4..3660f74dc2bfdb4cd7260a0eb2d175de7ed3edb2 100644 (file)
@@ -305,7 +305,7 @@ VAL3 iftest1.c
 VAL4 iftest1.c
 ], [])
 
-AT_CLEANUP(configure)
+AT_CLEANUP
 
 
 
@@ -456,7 +456,7 @@ AT_DATA(dst2, dst2
 AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
          [autoupdate: `configure.in' is updated
 ])
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
+AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
 AT_CHECK([cat src1], 0, [dst1
 ])
index 49de5947efca6f6a5273aeb8d81c7edd61881d61..f93e0c02b350e1b22d3a6f188842c943ad04e752 100644 (file)
@@ -32,26 +32,26 @@ AC_OUTPUT
 AT_CHECK_AUTOCONF
 
 # Create a header
-AT_CHECK([./configure what_to_test=header], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=header])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [header
 ])
 
 # Create a file
-AT_CHECK([./configure what_to_test=file], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=file])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [file
 ])
 
 # Execute a command
-AT_CHECK([./configure what_to_test=command], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=command])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [command
 ])
 
 # Create a link
-AT_CHECK([./configure what_to_test=link], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=link])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [link
 ])
 
-AT_CLEANUP(header file link command header.in file.in link.in command.in configure config.status)
+AT_CLEANUP(header file link command header.in file.in link.in command.in)
 
 
 
@@ -69,13 +69,13 @@ AC_OUTPUT
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 1, ignore,
+AT_CHECK_CONFIGURE([], [1], [],
 [[config.status: error: cannot find input file: nonexistent.in
 ]])
 # Make sure that the output file doesn't exist
 AT_CHECK([test -f nonexistent], 1)
 
-AT_CLEANUP(configure config.status config.log config.cache config.h defs)
+AT_CLEANUP
 
 
 
@@ -101,21 +101,21 @@ AC_OUTPUT
 
 AT_CHECK_AUTOCONF
 
-AT_CHECK([./configure one=one --enable-two=two --with-three=three |
-          sed -n -e 's/^result=//p'], 0,
-         [onetwothree
-], ignore)
-AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
+AT_CHECK_CONFIGURE([one=one --enable-two=two --with-three=three |
+                     sed -n -e 's/^result=//p'], 0,
+                   [onetwothree
+])
+AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
          [onetwothree
-], ignore)
+])
 
-AT_CHECK([./configure one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
-          sed -n -e 's/^result=//p'], 0,
-         ["'$ " ' $ "'$
-], ignore)
-AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
+AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
+                      sed -n -e 's/^result=//p'], 0,
+                   ["'$ " ' $ "'$
+])
+AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
          ["'$ " ' $ "'$
-], ignore)
+])
 
 AT_CLEANUP(configure config.status config.log config.cache)
 
@@ -130,7 +130,7 @@ AT_CLEANUP(configure config.status config.log config.cache)
 
 AT_SETUP([#define header templates])
 
-AT_DATA(configure.in,
+AT_DATA([configure.in],
 [[AC_INIT
 AC_CONFIG_HEADERS(config.h:config.hin)
 # I18n of dummy variables: their French translations.
@@ -150,11 +150,11 @@ AC_SUBST(DEFS_SAVED)
 AC_OUTPUT
 ]])
 
-AT_DATA(defs.in,
+AT_DATA([defs.in],
 [[@DEFS_SAVED@
 ]])
 
-AT_DATA(config.hin,
+AT_DATA([config.hin],
 [[#define foo   0
 #  define bar bar
 #  define baz   "Archimedes was sinking in his baz"
@@ -167,10 +167,10 @@ AT_DATA(config.hin,
 #undef aaa
 ]])
 
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0)
+AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
 
-AT_DATA(expout,
+AT_DATA([expout],
 [[/* config.h.  Generated automatically by configure.  */
 #define foo toto
 #  define bar tata
@@ -186,7 +186,7 @@ AT_DATA(expout,
 AT_CHECK([cat config.h], 0, expout)
 
 # Check the value of DEFS.  Note the leading space.
-AT_DATA(expout,
+AT_DATA([expout],
 [[ -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA]
 ])
 
@@ -194,7 +194,7 @@ AT_DATA(expout,
 # expout, hence nuke the one left by AC_OUTPUT_MAKE_DEFS.
 AT_CHECK([sed -e 's/ $//' defs], 0, expout)
 
-AT_CLEANUP(configure config.status config.log config.cache config.h defs)
+AT_CLEANUP