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): 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
[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])
[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])
## ---------------------------------------- ##
-# 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
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)
]])
AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
-AT_CLEANUP(configure)
+AT_CLEANUP
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
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
esac
]])
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
-AT_CHECK([./configure], 0)
-
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
AT_CLEANUP(configure)
#define HAVE_STDIO_H 1
])
-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+AT_CLEANUP
## ------------------------------ ##
#define HAVE_STDIO_H 1
])
-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+AT_CLEANUP
]])
AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
AT_CLEANUP(configure)
]])
AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
AT_CLEANUP(configure 1 a)
]])
AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE
AT_CLEANUP(configure)
# 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)
First, second , third, [,quoted]
]])
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+AT_CHECK_AUTOCONF([-o-], [expout])
-AT_CLEANUP()
+AT_CLEANUP
configure.in:2: the top level
])
-AT_CLEANUP()
+AT_CLEANUP
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]],
NEW
])
-AT_CLEANUP(autoconf.err)
+AT_CLEANUP
_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
])
VAL4 iftest1.c
], [])
-AT_CLEANUP(configure)
+AT_CLEANUP
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
])
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)
]])
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
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)
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.
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"
#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
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]
])
# 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