autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

31-autotest-initializes-m4sh.patch


From: Akim Demaille
Subject: 31-autotest-initializes-m4sh.patch
Date: Mon, 20 Aug 2001 16:47:43 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        Autotest invokes M4sh's initialization.
        
        * lib/autotest/general.m4: Adjust the diversion names.
        (AT_INIT): Run AS_INIT.
        Use the BINSH diversion to invoke /bin/sh.
        * tests/base.at, tests/m4sh.at, tests/m4sugar.at, tests/tools.at:
        * tests/torture.at: Respect M4sugar and M4sh macro name spaces.
        
        
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Sun, 19 Aug 2001 09:58:15 +0200 akim
+++ lib/autotest/general.m4 Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -62,16 +62,13 @@
 #    tail of the core for;case, overall wrap up, generation of debugging
 #    scripts and statistics.
 
-m4_define([_m4_divert(DEFAULT)],       0)
+m4_define([_m4_divert(DEFAULT)],       5)
 m4_define([_m4_divert(OPTIONS)],      10)
 m4_define([_m4_divert(HELP)],         20)
 m4_define([_m4_divert(SETUP)],        30)
 m4_define([_m4_divert(TESTS)],        50)
 m4_define([_m4_divert(TAIL)],         60)
 
-m4_divert_push([TESTS])
-m4_divert_push([KILL])
-
 
 # AT_LINE
 # -------
@@ -85,12 +82,13 @@ 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_pattern_forbid([^_?AT_])
+[AS_INIT
+m4_pattern_forbid([^_?AT_])
 m4_define([AT_ordinal], 0)
 m4_define([AT_banner_ordinal], 0)
 m4_define([AT_data_files], [stdout expout at-* stderr experr ])
+m4_divert_text([BINSH], address@hidden:@! /bin/sh])
 m4_divert_push([DEFAULT])dnl
-#! /bin/sh
 
 AS_SHELL_SANITIZE
 SHELL=${CONFIG_SHELL-/bin/sh}
@@ -313,8 +311,8 @@ Tests:
 $at_debug || rm -rf $at_data_files
 
 # Wrap up the test suite with summary statistics.
-at_skip_count=`set dummy $at_skip_list; shift; echo $[#]`
-at_fail_count=`set dummy $at_fail_list; shift; echo $[#]`
+at_skip_count=`set dummy $at_skip_list; shift; echo address@hidden:@]`
+at_fail_count=`set dummy $at_fail_list; shift; echo address@hidden:@]`
 if test $at_fail_count = 0; then
   if test $at_skip_count = 0; then
     AS_BOX([All $at_test_count tests were successful])
@@ -380,7 +378,7 @@ Tests:
 fi
 
 exit 0
-m4_divert_pop()dnl
+m4_divert_pop([TAIL])dnl
 m4_wrap([m4_divert_text([DEFAULT],
                         [# List of the tests.
 at_tests_all="AT_TESTS_ALL "])])dnl
Index: tests/base.at
--- tests/base.at Sun, 19 Aug 2001 10:26:42 +0200 akim
+++ tests/base.at Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -30,8 +30,8 @@
 
 AT_DATA(configure.ac,
 [[define([REQUIRE_AND_CHECK],
-[AC_REQUIRE([$1])dnl
-test -z "$m4_translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
+[AC_REQUIRE([$1])
+test -z "address@hidden@_translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
 
 AC_DEFUN([TEST1],
 [REQUIRE_AND_CHECK([TEST2a])
@@ -49,7 +49,7 @@ AC_DEFUN([TEST3],
 [REQUIRE_AND_CHECK([TEST2a])
 test3=set])
 
-AC_PLAIN_SCRIPT()dnl
+AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 TEST1
@@ -82,7 +82,7 @@ AC_DEFUN([MULTI_TEST],
 AC_DEFUN_ONCE([SINGLE_TEST],
 [single_test=".$single_test"])
 
-AC_PLAIN_SCRIPT()dnl
+AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 TEST
@@ -127,7 +127,7 @@ AC_DEFUN([MULTI_TEST],
 AC_DEFUN_ONCE([SINGLE_TEST],
 [single_test=".$single_test"])
 
-AC_PLAIN_SCRIPT()dnl
+AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 MULTI_TEST
@@ -167,7 +167,7 @@ AC_DEFUN_ONCE([SINGLE_TEST],
 AC_DEFUN([INNER_TEST],
 [inner_test=".$inner_test"])
 
-AC_PLAIN_SCRIPT()dnl
+AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 AC_PROVIDE([INNER_TEST])
Index: tests/m4sh.at
--- tests/m4sh.at Sun, 19 Aug 2001 10:26:42 +0200 akim
+++ tests/m4sh.at Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -19,22 +19,24 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
+# Used in many tests.
+m4_pattern_allow([^AS_EXIT$])
 
 ## ----------------------------- ##
 ## AS_DIRNAME & AS_DIRNAME_SED.  ##
 ## ----------------------------- ##
 
 # Build nested dirs.
-
+m4_pattern_allow([^AS_DIRNAME(_SED)?$])
 AT_SETUP([[AS_DIRNAME & AS_DIRNAME_SED]])
 
 AT_DATA(configure.ac,
-[[AC_PLAIN_SCRIPT()dnl
+[[AC_PLAIN_SCRIPT()
 #! /bin/sh
 
-_AS_EXPR_PREPARE
address@hidden@_EXPR_PREPARE
 
-define([AS_DIRNAME_TEST],
+m4_define([DIRNAME_TEST],
 [dir=`AS_DIRNAME([$1])`
 test "$dir" = "$2" ||
   echo "dirname($1) = $dir instead of $2" >&2
@@ -43,26 +45,26 @@
 test "$dir" = "$2" ||
   echo "dirname_sed($1) = $dir instead of $2" >&2])
 
-AS_DIRNAME_TEST([//1],         [//])
-AS_DIRNAME_TEST([/1],          [/])
-AS_DIRNAME_TEST([./1],         [.])
-AS_DIRNAME_TEST([../../2],     [../..])
-AS_DIRNAME_TEST([//1/],                [//])
-AS_DIRNAME_TEST([/1/],         [/])
-AS_DIRNAME_TEST([./1/],                [.])
-AS_DIRNAME_TEST([../../2],     [../..])
-AS_DIRNAME_TEST([//1/3],       [//1])
-AS_DIRNAME_TEST([/1/3],                [/1])
-AS_DIRNAME_TEST([./1/3],       [./1])
-AS_DIRNAME_TEST([../../2/3],   [../../2])
-AS_DIRNAME_TEST([//1/3///],    [//1])
-AS_DIRNAME_TEST([/1/3///],     [/1])
-AS_DIRNAME_TEST([./1/3///],    [./1])
-AS_DIRNAME_TEST([../../2/3///],        [../../2])
-AS_DIRNAME_TEST([//1//3/],     [//1])
-AS_DIRNAME_TEST([/1//3/],      [/1])
-AS_DIRNAME_TEST([./1//3/],     [./1])
-AS_DIRNAME_TEST([../../2//3/], [../../2])
+DIRNAME_TEST([//1],            [//])
+DIRNAME_TEST([/1],             [/])
+DIRNAME_TEST([./1],            [.])
+DIRNAME_TEST([../../2],                [../..])
+DIRNAME_TEST([//1/],           [//])
+DIRNAME_TEST([/1/],            [/])
+DIRNAME_TEST([./1/],           [.])
+DIRNAME_TEST([../../2],                [../..])
+DIRNAME_TEST([//1/3],          [//1])
+DIRNAME_TEST([/1/3],           [/1])
+DIRNAME_TEST([./1/3],          [./1])
+DIRNAME_TEST([../../2/3],      [../../2])
+DIRNAME_TEST([//1/3///],       [//1])
+DIRNAME_TEST([/1/3///],                [/1])
+DIRNAME_TEST([./1/3///],       [./1])
+DIRNAME_TEST([../../2/3///],   [../../2])
+DIRNAME_TEST([//1//3/],                [//1])
+DIRNAME_TEST([/1//3/],         [/1])
+DIRNAME_TEST([./1//3/],                [./1])
+DIRNAME_TEST([../../2//3/],    [../../2])
 AS_EXIT(0)
 ]])
 
@@ -78,11 +80,11 @@
 ## ------------ ##
 
 # Build nested dirs.
-
+m4_pattern_allow([^AS_MKDIR_P$])
 AT_SETUP([[AS_MKDIR_P]])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()dnl
+[[AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 pwd=`pwd`
@@ -116,7 +118,7 @@
 AT_SETUP([Negated classes in globbing])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()dnl
+[[AC_PLAIN_SCRIPT()
 #! /bin/sh
 
 case 'with!two!bangs' in
@@ -132,4 +134,4 @@
 AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
 
-AT_CLEANUP(configure)
+AT_CLEANUP
Index: tests/m4sugar.at
--- tests/m4sugar.at Sun, 19 Aug 2001 10:26:42 +0200 akim
+++ tests/m4sugar.at Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -32,6 +32,7 @@
 ## m4_warn.  ##
 ## --------- ##
 
+m4_pattern_allow([^m4_warn$])
 AT_SETUP([[m4_warn]])
 
 # m4_text_wrap is used to display the help strings.  Also, check that
@@ -73,6 +74,7 @@ script.s4g:2: the top level
 ## m4_require: circular dependencies.  ##
 ## ----------------------------------- ##
 
+m4_pattern_allow([^m4_(require|defun|init)$])
 AT_SETUP([[m4_require: circular dependencies]])
 
 # m4_text_wrap is used to display the help strings.  Also, check that
@@ -111,6 +113,7 @@ script.s4g:11: the top level
 ## m4_text_wrap.  ##
 ## -------------- ##
 
+m4_pattern_allow([^m4_text_wrap$])
 AT_SETUP([[m4_text_wrap]])
 
 # m4_text_wrap is used to display the help strings.  Also, check that
@@ -118,7 +121,7 @@ script.s4g:11: the top level
 # m4-listification.
 
 AT_DATA([script.s4g],
-[[m4_divert_push([0])m4_wrap([m4_divert_pop([0])])dnl
address@hidden@_divert_push([0])address@hidden@_wrap(address@hidden@_divert_pop([0])])address@hidden@nl
 m4_text_wrap([Short string */], [   ], [/* ], 20)
 
 m4_text_wrap([Much longer string */], [   ], [/* ], 20)
Index: tests/tools.at
--- tests/tools.at Sun, 19 Aug 2001 10:26:42 +0200 akim
+++ tests/tools.at Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -133,6 +133,7 @@
 # -----------------------------
 AT_SETUP([autoconf --trace: user macros])
 
+m4_pattern_allow([^m4_(define|shift)$])
 AT_DATA(configure.ac,
 [[m4_define([active], [ACTIVE])
 m4_define([TRACE1], [TRACE2(m4_shift($@))])
@@ -252,6 +253,7 @@ configure.ac:19:TRACE2:bar foo
 # ---------------------------------
 AT_SETUP([autoconf: forbidden tokens, basic])
 
+m4_pattern_allow([^(m4_foo|_m4_bar|AS_FOO|_AS_BAR)$])
 AT_DATA([configure.ac],
 [[AC_PLAIN_SCRIPT()
 AC_FOO
@@ -262,7 +264,7 @@ configure.ac:19:TRACE2:bar foo
 B_AC_FOO
 AS_FOO
 _AS_BAR
-[dnl]
address@hidden@nl]
 ]])
 
 AT_CHECK_AUTOCONF([], 1, [],
@@ -273,7 +275,7 @@ configure.ac:5: error: possibly undefine
 configure.ac:7: error: possibly undefined macro: B_AC_FOO
 configure.ac:8: error: possibly undefined macro: AS_FOO
 configure.ac:9: error: possibly undefined macro: _AS_BAR
-configure.ac:10: error: possibly undefined macro: dnl
+configure.ac:10: error: possibly undefined macro: address@hidden@nl
 ]])
 
 AT_CLEANUP
@@ -284,16 +286,16 @@ configure.ac:10: error: possibly undefin
 AT_SETUP([autoconf: forbidden tokens, exceptions])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()dnl
+[[AC_PLAIN_SCRIPT
 
 # This is allowed in spite of the name.
 # It is on purpose that we check the case where there are several
 # tokens on the same line.
-m4_pattern_allow([^AC_ALLOWED$])
address@hidden@_pattern_allow([^AC_ALLOWED$])
 NOT_AC_ALLOWED AC_ALLOWED AC_ALLOWED_NOT
 
 # Test forbidding.
-m4_pattern_forbid([^FORBIDDEN$])
address@hidden@_pattern_forbid([^FORBIDDEN$])
 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
 
 # Test Autoconf's patterns.
@@ -464,7 +466,7 @@ configure:18: error: possibly undefined 
 AT_DATA(configure.ac,
 [[AC_INIT(Test, 1.0)
 AC_CANONICAL_SYSTEM
-dnl The doc says 27 is a valid fubar.
+# The doc says 27 is a valid fubar.
 fubar=27
 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
 ]])
@@ -472,7 +474,7 @@ configure:18: error: possibly undefined 
 AT_DATA([expout],
 [[AC_INIT([Test],[1.0])
 AC_CANONICAL_TARGET([])
-dnl The doc says 27 is a valid fubar.
+# The doc says 27 is a valid fubar.
 fubar=27
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_COMMANDS([default],[[echo $fubar]],[[fubar=$fubar]])
Index: tests/torture.at
--- tests/torture.at Sun, 19 Aug 2001 10:26:42 +0200 akim
+++ tests/torture.at Sun, 19 Aug 2001 11:28:33 +0200 akim
@@ -348,6 +348,9 @@ m4_define([AT_CHECK_CONFIG_CREATION],
 ## in config.status.  sed is used to skip the first two lines
 ## `Generated by...'.
 
+# We use m4_for many times.
+m4_pattern_allow([^m4_for$])
+
 AT_SETUP([Torturing config.status])
 
 dnl The value used as a big value for AC_DEFINE.
@@ -370,6 +373,7 @@ m4_define([AT_DESCRIPTION],
 # turned into ac_uummy during the construction of config.status.  Yes,
 # this is admittedly a bug, but it would be too hard to fix this.
 # There is really no point in AC_DEFINE a var named ac_d.*.
+m4_pattern_allow([^m4_patsubst$])
 m4_define([AT_DUMMY_VAR],
 [ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
 
@@ -385,7 +389,7 @@ m4_define([AT_DUMMY_VAR],
 # configure.ac #
 # ------------ #
 
-AT_DATA(configure.ac,
+AT_DATA([configure.ac],
 dnl The following lines transfer AT_DUMMY_VAR, AT_DESCRIPTION, and
 dnl AT_BIG_VALUE into the configure.ac as AC_DUMMY_VAR etc.
 [[m4_define([AC_DUMMY_VAR],]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]