+2001-08-07 Akim Demaille <akim@epita.fr>
+
+ The use of `dumpstat' revealed that `len' was used although it
+ should not. m4_text_wrap was using it, but in the Autoconf world
+ where it is legal. Hence (i) test M4sh in its own world, not
+ Autoconf's, and (ii), ahem, fix the bug :)
+
+ * lib/autotest/general.m4: Be sure the set good quotes, as tracing
+ does not like `' instead of [].
+ (AT_INIT): Forbid `^_?AT_'.
+ And don't output such tokens.
+ * tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
+ `script.as', and `autom4te.cache'.
+ Remove `empty' and `macro' which are no longer used.
+ * tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
+ * tests/m4sugar.at: Use it.
+ * lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
+
2001-08-07 Akim Demaille <akim@epita.fr>
* bin/autoconf.in, bin/autoheader.in: --force, -f is a new option.
-include(m4sugar/m4sh.m4)# -*- Autoconf -*-
+changequote()changequote([, ])include(m4sugar/m4sh.m4)# -*- Autoconf -*-
# M4 macros used in building test suites.
# Copyright 2000, 2001 Free Software Foundation, Inc.
# Begin test suite, using PROGRAM to check version. The search path
# should be already preset so the proper executable will be selected.
m4_define([AT_INIT],
-[m4_define([AT_ordinal], 0)
+[m4_pattern_forbid([^_?AT_])
+m4_define([AT_ordinal], 0)
m4_define([AT_banner_ordinal], 0)
m4_define([AT_data_files],
[stdout expout at-setup-line at-check-line at-stdout stderr experr
*)
if test ! -f at-check-line; then
echo "$as_me: warning: no at-check-line which means a failure happened"
- echo "$as_me: warning: in a [AT_SETUP/AT_CLEANUP] pair before any"
- echo "$as_me: warning: [AT_CHECK] could be run. This test suite is"
+ echo "$as_me: warning: in a [AT""_SETUP/AT""_CLEANUP] pair before any"
+ echo "$as_me: warning: [AT""_CHECK] could be run. This test suite is"
echo "$as_me: warning: improperly designed, please report to"
echo "$as_me: warning: <$at_bugreport>."
cp at-setup-line at-check-line
1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
m4_Prefix])[]dnl
m4_foreach_quoted([m4_Word], (m4_split(m4_normalize([$1]))),
-[m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
+[m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_len(m4_Word) + 1))dnl
dnl New line if too long, else insert a space unless it is the first
dnl of the words.
m4_if(m4_eval(m4_Cursor > m4_Width),
actypes.at: mktests.sh $(MACRO_FILES)
cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
-CLEANFILES = debug-*.sh macro configure configure.in configure.ac \
- config.status config.cache config.log config.h.in config.h \
- config.hin state-* at-* \
- stderr stdout empty \
- config.guess config.sub expr libtool ltconfig ltmain.sh install-sh
+CLEANFILES = \
+ debug-*.sh state-* at-* stderr stdout \
+ autom4te.cache \
+ script.s4g script.as script \
+ configure configure.in configure.ac config.status config.cache \
+ config.log config.h.in config.hin config.h \
+ config.guess config.sub install-sh \
+ expr \
+ libtool ltconfig ltmain.sh
+
DISTCLEANFILES = atconfig testsuite
MACRO_FILES = $(top_srcdir)/lib/autoconf/general.m4 $(top_srcdir)/lib/autoconf/specific.m4 $(top_srcdir)/lib/autoconf/functions.m4 $(top_srcdir)/lib/autoconf/lang.m4 $(top_srcdir)/lib/autoconf/c.m4 $(top_srcdir)/lib/autoconf/fortran.m4 $(top_srcdir)/lib/autoconf/headers.m4 $(top_srcdir)/lib/autoconf/types.m4
-CLEANFILES = debug-*.sh macro configure configure.in configure.ac config.status config.cache config.log config.h.in config.h config.hin state-* at-* stderr stdout empty config.guess config.sub expr libtool ltconfig ltmain.sh install-sh
+CLEANFILES = debug-*.sh state-* at-* stderr stdout autom4te.cache script.s4g script.as script configure configure.in configure.ac config.status config.cache config.log config.h.in config.hin config.h config.guess config.sub install-sh expr libtool ltconfig ltmain.sh
+
DISTCLEANFILES = atconfig testsuite
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_CLEAN_FILES = atconfig
-DIST_COMMON = README Makefile.am Makefile.in atconfig.in
+DIST_COMMON = README Makefile.am Makefile.in atconfig.in configure.ac
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
changequote()changequote([, ])include(autotest/general.m4)# -*- Autoconf -*-
# M4 macros used in building Autoconf test suites.
+# Copyright 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 02111-1307, USA.
+## ------------------------------------ ##
+## Macros specialized in testing M4sh. ##
+## ------------------------------------ ##
+
+# AT_CHECK_M4SUGAR(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# ----------------------------------------------------------
+m4_define([AT_CHECK_M4SUGAR],
+[AT_CLEANUP_FILES([script.4s script autom4te.cache])dnl
+AT_CHECK([autom4te -I ../lib m4sugar/m4sugar.m4 script.s4g -o script $1],
+ m4_default([$2], [0]), [$3], [$4])])
+
+
+# AT_CHECK_M4SH(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# -------------------------------------------------------
+m4_define([AT_CHECK_M4SH],
+[AT_CLEANUP_FILES([script.as script autom4te.cache])dnl
+AT_CHECK([autom4te -I ../lib m4sugar/m4sh.m4 script.as -o script $1],
+ m4_default([$2], [0]), [$3], [$4])])
+
+
## ---------------------------------------- ##
## Macros specialized in testing Autoconf. ##
## ---------------------------------------- ##
# AT_CHECK_AUTOCONF(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
# -----------------------------------------------------------
-# Also remove `configure.in', just in case one remained from a previous
-# run.
m4_define([AT_CHECK_AUTOCONF],
[AT_CLEANUP_FILES(configure.in configure autom4te.cache)dnl
AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir $1],
# commas are not swallowed. This can easily happen because of
# m4-listification.
-AT_DATA(configure.ac,
+AT_DATA([script.s4g],
[[m4_warn([foo], [foo])
m4_warn([bar], [bar])
m4_warn([syntax], [syntax])
]])
-AT_CHECK_AUTOCONF([-o-],
- 0, [],
-[configure.ac:3: warning: syntax
+AT_CHECK_M4SUGAR([-o-], 0, [],
+[script.s4g:3: warning: syntax
])
-AT_CHECK_AUTOCONF([-o- -Wall],
- 0, [],
-[configure.ac:1: warning: foo
-configure.ac:2: warning: bar
-configure.ac:3: warning: syntax
+AT_CHECK_M4SUGAR([-o- -Wall], 0, [],
+[script.s4g:1: warning: foo
+script.s4g:2: warning: bar
+script.s4g:3: warning: syntax
])
-AT_CHECK_AUTOCONF([-o- -Wnone,bar],
- 0, [],
-[configure.ac:2: warning: bar
+AT_CHECK_M4SUGAR([-o- -Wnone,bar], 0, [],
+[script.s4g:2: warning: bar
])
-AT_CHECK_AUTOCONF([-o- -Wnone,bar,error],
- 1, [],
-[configure.ac:2: error: bar
-configure.ac:2: the top level
+AT_CHECK_M4SUGAR([-o- -Wnone,bar,error], 1, [],
+[script.s4g:2: error: bar
+script.s4g:2: the top level
])
AT_CLEANUP
# commas are not swallowed. This can easily happen because of
# m4-listification.
-AT_DATA([configure.ac],
+AT_DATA([script.s4g],
[[m4_defun([foo],
[m4_require([bar])])
baz
]])
-AT_CHECK_AUTOCONF([], 1, [],
-[[configure.ac:11: error: m4_require: circular dependency of foo
-configure.ac:11: foo is required by...
-configure.ac:5: bar is expanded from...
-configure.ac:11: bar is required by...
-configure.ac:2: foo is expanded from...
-configure.ac:11: foo is required by...
-configure.ac:8: baz is expanded from...
-configure.ac:11: the top level
+AT_CHECK_M4SUGAR([], 1, [],
+[[script.s4g:11: error: m4_require: circular dependency of foo
+script.s4g:11: foo is required by...
+script.s4g:5: bar is expanded from...
+script.s4g:11: bar is required by...
+script.s4g:2: foo is expanded from...
+script.s4g:11: foo is required by...
+script.s4g:8: baz is expanded from...
+script.s4g:11: the top level
]])
AT_CLEANUP
# commas are not swallowed. This can easily happen because of
# m4-listification.
-AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()dnl
+AT_DATA([script.s4g],
+[[m4_divert_push([0])m4_wrap([m4_divert_pop([0])])dnl
m4_text_wrap([Short string */], [ ], [/* ], 20)
m4_text_wrap([Much longer string */], [ ], [/* ], 20)
First, second , third, [,quoted]
]])
-AT_CHECK_AUTOCONF([-o-], 0, [expout])
+AT_CHECK_M4SUGAR([-o-], 0, [expout])
AT_CLEANUP