]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
The use of `dumpstat' revealed that `len' was used although it
authorAkim Demaille <akim@epita.fr>
Tue, 7 Aug 2001 07:56:40 +0000 (07:56 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 7 Aug 2001 07:56:40 +0000 (07:56 +0000)
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'.

ChangeLog
lib/autotest/general.m4
lib/m4sugar/m4sugar.m4
tests/Makefile.am
tests/Makefile.in
tests/atspecific.m4
tests/m4sugar.at

index c3ef29dee50e14b830a862a8fc1c6fa0b65611c9..d6e6924b6f887c42334028995af7f4a24d0a8a88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+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.
index 62122f160d47517f1a12eb6e2cb960244c3f5510..344f8213c5aab9293dc664ac8202199984377066 100644 (file)
@@ -1,4 +1,4 @@
-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.
 
@@ -86,7 +86,8 @@ m4_define([AT_LINE],
 # 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
@@ -242,8 +243,8 @@ m4_divert([TAIL])[]dnl
     *)
       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
index 817561ca5425ea0f858a4b507ef6cd464ab81179..10472d88a03c2a643f0552046b8c652070fe8b86 100644 (file)
@@ -1586,7 +1586,7 @@ m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
       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),
index cec125882c667aa881a2aca59790dc89023e9aaa..f234132c79193fb89ebd175a1f21041496afd9fe 100644 (file)
@@ -87,11 +87,16 @@ acheaders.at: mktests.sh $(MACRO_FILES)
 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
 
 
index b9ff0069eddf12990a07b75c5f68974b78144f6f..c6a2250d3167d23f27e084cda32495bc077b37d9 100644 (file)
@@ -84,12 +84,13 @@ AUTOM4TE = autom4te_perllibdir='$(top_srcdir)/lib' ../bin/autom4te
 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)
index 1cc03139992d5547980e3f5428d49dac6236d7a0..c597a2cdcbd51d8214315f6c160e1b066da49b8c 100644 (file)
@@ -1,5 +1,6 @@
 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
@@ -17,6 +18,26 @@ changequote()changequote([, ])include(autotest/general.m4)# -*- Autoconf -*-
 # 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.  ##
 ## ---------------------------------------- ##
@@ -41,8 +62,6 @@ AC_STATE_SAVE(after)
 
 # 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],
index ad83d5edec38ee7c600afce1d8e283e490f48b03..5993a9473ba427d3a1b5e2aff191df529fdcc311 100644 (file)
@@ -21,33 +21,29 @@ AT_SETUP([[m4_warn]])
 # 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
@@ -63,7 +59,7 @@ AT_SETUP([[m4_require: circular dependencies]])
 # 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])])
 
@@ -77,15 +73,15 @@ m4_init
 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
@@ -101,8 +97,8 @@ AT_SETUP([[m4_text_wrap]])
 # 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)
@@ -134,6 +130,6 @@ AT_DATA(expout,
 First, second , third, [,quoted]
 ]])
 
-AT_CHECK_AUTOCONF([-o-], 0, [expout])
+AT_CHECK_M4SUGAR([-o-], 0, [expout])
 
 AT_CLEANUP