[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
13-fyi-test-m4sugar.patch
From: |
Akim Demaille |
Subject: |
13-fyi-test-m4sugar.patch |
Date: |
Mon, 06 Aug 2001 10:22:56 +0200 |
Index: ChangeLog
from Akim Demaille <address@hidden>
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'.
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Thu, 26 Jul 2001 21:23:21 +0200 akim
+++ lib/autotest/general.m4 Sun, 05 Aug 2001 22:07:47 +0200 akim
@@ -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 @@ Tests:
*)
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: lib/m4sugar/m4sugar.m4
--- lib/m4sugar/m4sugar.m4 Sat, 04 Aug 2001 12:33:38 +0200 akim
+++ lib/m4sugar/m4sugar.m4 Sun, 05 Aug 2001 21:50:51 +0200 akim
@@ -1586,7 +1586,7 @@ m4_define([m4_text_wrap],
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: tests/Makefile.am
--- tests/Makefile.am Wed, 01 Aug 2001 23:34:52 +0200 akim
+++ tests/Makefile.am Sun, 05 Aug 2001 22:15:16 +0200 akim
@@ -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: tests/atspecific.m4
--- tests/atspecific.m4 Thu, 26 Jul 2001 21:23:21 +0200 akim
+++ tests/atspecific.m4 Sun, 05 Aug 2001 22:06:22 +0200 akim
@@ -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 @@
# 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 @@ m4_define([AT_CONFIGURE_AC],
# 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: tests/m4sugar.at
--- tests/m4sugar.at Sat, 04 Aug 2001 18:47:20 +0200 akim
+++ tests/m4sugar.at Sun, 05 Aug 2001 22:10:29 +0200 akim
@@ -21,33 +21,29 @@
# 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 @@ configure.ac:2: the top level
# 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 @@ configure.ac:2: the top level
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 @@ configure.ac:11: the top level
# 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 @@ configure.ac:11: the top level
First, second , third, [,quoted]
]])
-AT_CHECK_AUTOCONF([-o-], 0, [expout])
+AT_CHECK_M4SUGAR([-o-], 0, [expout])
AT_CLEANUP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 13-fyi-test-m4sugar.patch,
Akim Demaille <=