[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
30-autom4te-autotest.patch
From: |
DEMAILLE Akim |
Subject: |
30-autom4te-autotest.patch |
Date: |
Mon, 20 Nov 2000 10:18:26 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
Move Autotest on top of M4sh.
* tests/atgeneral.m4: Import M4sh.
Adjust the differences on the names of the builtins (define etc.).
(AT_CASE): Remove, use m4_case.
(AT_SETUP): Don't use `AT_group_description', `$1' is OK.
* tests/atspecific.m4 (m4_for, m4_foreach): Remove, use those of
M4sugar.
* tests/m4sugar.at: Strengthen the quotation and adjust to the new
macro names.
* tests/m4sh.at: Ditto.
* tests/torture.at: Ditto.
* tests/base.at: Ditto.
* m4sh.m4: Import M4sugar.
* autoconf.m4: Don't import M4sugar, M4sh does.
Index: autoconf.m4
--- autoconf.m4 Sat, 11 Nov 2000 18:44:22 +0100 akim (ace/28_autoconf.m 1.13
644)
+++ autoconf.m4 Sat, 18 Nov 2000 12:13:41 +0100 akim (ace/28_autoconf.m 1.13
644)
@@ -1,4 +1,4 @@
-include(m4sugar.m4)# -*- Autoconf -*-
+include(m4sh.m4)# -*- Autoconf -*-
# This file is part of Autoconf.
# Driver that loads the Autoconf macro files.
# Copyright 1994, 1999, 2000 Free Software Foundation, Inc.
@@ -23,8 +23,6 @@
# Do not sinclude acsite.m4 here, because it may not be installed
# yet when Autoconf is frozen.
# Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
-
-m4_include([m4sh.m4])
m4_include([acversion.m4])
m4_include([acgeneral.m4])
Index: m4sh.m4
--- m4sh.m4 Sun, 12 Nov 2000 16:11:30 +0100 akim (ace/b/41_m4sh.m4 1.8 644)
+++ m4sh.m4 Sat, 18 Nov 2000 12:13:26 +0100 akim (ace/b/41_m4sh.m4 1.8 644)
@@ -1,4 +1,4 @@
-divert(-1)# -*- Autoconf -*-
+include(m4sugar.m4)# -*- Autoconf -*-
# This file is part of Autoconf.
# M4 sugar for common shell constructs.
# Requires GNU M4 and M4sugar.
Index: tests/Makefile.am
--- tests/Makefile.am Sat, 18 Nov 2000 12:03:30 +0100 akim (ace/b/17_Makefile.a
1.32 644)
+++ tests/Makefile.am Sat, 18 Nov 2000 12:09:50 +0100 akim (ace/b/17_Makefile.a
1.32 644)
@@ -34,7 +34,7 @@
$(SHELL) testsuite
testsuite: atgeneral.m4 atspecific.m4 $(SUITE)
- $(M4) -I $(srcdir) atspecific.m4 suite.at | \
+ $(M4) -I $(srcdir) -I $(top_srcdir) atspecific.m4 suite.at | \
sed -e 's/[ ]*$$//' | \
sed -e '/^$$/N;/\n$$/D' > address@hidden
chmod +x address@hidden
Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Sat, 18 Nov 2000 12:03:30 +0100 akim
(ace/b/19_atgeneral. 1.19 644)
+++ tests/atgeneral.m4 Sat, 18 Nov 2000 14:48:08 +0100 akim
(ace/b/19_atgeneral. 1.19 644)
@@ -1,6 +1,6 @@
-divert(-1) -*- Autoconf -*-
+include(m4sh.m4) -*- Autoconf -*-
# `m4' macros used in building test suites.
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright 2000 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
@@ -45,48 +45,12 @@
# any notice of this special exception to the GPL from your modified
# version.
-changequote()
-changequote([, ])
-define([AT_DEFINE], defn([define]))
-define([AT_EVAL], defn([eval]))
-define([AT_FORMAT], defn([format]))
-define([AT_INCLUDE], defn([include]))
-define([AT_SHIFT], defn([shift]))
-define([AT_UNDEFINE], defn([undefine]))
-
-undefine([define])
-undefine([eval])
-undefine([format])
-undefine([include])
-undefine([shift])
-undefine([undefine])
-
-
-# AT_CASE(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
-# -----------------------------------------------------------
-# m4 equivalent of
-# switch (SWITCH)
-# {
-# case VAL1:
-# IF-VAL1;
-# break;
-# case VAL2:
-# IF-VAL2;
-# break;
-# ...
-# default:
-# DEFAULT;
-# break;
-# }.
-# All the values are optional, and the macro is robust to active
-# symbols properly quoted.
-AT_DEFINE([AT_CASE],
-[ifelse([$#], 0, [],
- [$#], 1, [],
- [$#], 2, [$2],
- [$1], [$2], [$3],
- [AT_CASE([$1], AT_SHIFT(AT_SHIFT(AT_SHIFT($@))))])])
+m4_define([AT_DEFINE], m4_defn([m4_define]))
+m4_define([AT_INCLUDE], m4_defn([m4_include]))
+m4_define([AT_SHIFT], m4_defn([m4_shift]))
+m4_define([AT_UNDEFINE], m4_defn([m4_undefine]))
+
# Use of diversions:
@@ -99,7 +63,7 @@
# -------
# Return the current file sans directory, a colon, and the current line.
AT_DEFINE([AT_LINE],
-[patsubst(__file__, ^.*/\(.*\), \1):__line__])
+[m4_patsubst(__file__, ^.*/\(.*\), \1):__line__])
# AT_INIT(PROGRAM)
@@ -273,28 +237,27 @@
# Start a group of related tests, all to be executed in the same subshell.
# The group is testing what DESCRIPTION says.
AT_DEFINE([AT_SETUP],
-[AT_DEFINE([AT_ordinal], AT_EVAL(AT_ordinal + 1))
-pushdef([AT_group_description], [$1])
-pushdef([AT_data_files], )
-pushdef([AT_data_expout], )
-pushdef([AT_data_experr], )
+[AT_DEFINE([AT_ordinal], m4_eval(AT_ordinal + 1))
+m4_pushdef([AT_data_files], )
+m4_pushdef([AT_data_expout], )
+m4_pushdef([AT_data_experr], )
if $at_stop_on_error && test -n "$at_failed_list"; then :; else
divert(1)[]dnl
echo AT_LINE > at-check-line
echo AT_LINE > at-setup-line
if $at_verbose; then
- echo 'testing AT_group_description'
+ echo 'testing $1'
echo $at_n " $at_c"
fi
if $at_verbose; then
echo "AT_ordinal. $srcdir/AT_LINE..."
else
- echo $at_n "substr(AT_ordinal. $srcdir/AT_LINE
, 0, 30)[]$at_c"
+ echo $at_n "m4_substr(AT_ordinal. $srcdir/AT_LINE
, 0, 30)[]$at_c"
fi
if test -z "$at_skip_mode"; then
(
[#] Snippet (d[]AT_ordinal[](
-[#] Testing AT_group_description
+[#] Testing $1
[#] Snippet )d[]AT_ordinal[])
[#] Snippet (s[]AT_ordinal[](
[#] starting from `AT_LINE'.
@@ -339,10 +302,10 @@
rm ifelse([AT_data_files$1], , [-f], [-rf[]AT_data_files[]ifelse($1, , , [
$1])]) stdout stderr[]AT_data_expout[]AT_data_experr
fi
fi
-popdef([AT_data_experr])
-popdef([AT_data_expout])
-popdef([AT_data_files])
-popdef([AT_group_description])[]dnl
+m4_popdef([AT_data_experr])
+m4_popdef([AT_data_expout])
+m4_popdef([AT_data_files])
+m4_popdef([AT_group_description])[]dnl
])# AT_CLEANUP
@@ -372,7 +335,7 @@
# their content is not checked.
AT_DEFINE([AT_CHECK],
[$at_traceoff
-$at_verbose && echo "$srcdir/AT_LINE: patsubst([$1], [\([\"`$]\)], \\\1)"
+$at_verbose && echo "$srcdir/AT_LINE: m4_patsubst([$1], [\([\"`$]\)], \\\1)"
echo AT_LINE > at-check-line
$at_check_stds && exec 5>&1 6>&2 1>stdout 2>stderr
$at_traceon
@@ -395,18 +358,18 @@
dnl If not verbose, neutralize the output of diff.
$at_verbose || exec 1>/dev/null 2>/dev/null
at_failed=false;
- AT_CASE([$4],
+ m4_case([$4],
ignore, [$at_verbose && cat stderr;:],
experr, [AT_DEFINE([AT_data_experr], [ experr])dnl
$at_diff experr stderr || at_failed=:],
[], [$at_diff empty stderr || at_failed=:],
- [echo $at_n "patsubst([$4], [\([\"`$]\)], \\\1)$at_c" | $at_diff -
stderr || at_failed=:])
- AT_CASE([$3],
+ [echo $at_n "m4_patsubst([$4], [\([\"`$]\)], \\\1)$at_c" | $at_diff
- stderr || at_failed=:])
+ m4_case([$3],
ignore, [$at_verbose && cat stdout;:],
expout, [AT_DEFINE([AT_data_expout], [ expout])dnl
$at_diff expout stdout || at_failed=:],
[], [$at_diff empty stdout || at_failed=:],
- [echo $at_n "patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff -
stdout || at_failed=:])
+ [echo $at_n "m4_patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff
- stdout || at_failed=:])
if $at_failed; then
exit 1
else
Index: tests/atspecific.m4
--- tests/atspecific.m4 Sun, 12 Nov 2000 15:50:30 +0100 akim
(ace/b/24_atspecific 1.19 644)
+++ tests/atspecific.m4 Sat, 18 Nov 2000 12:09:32 +0100 akim
(ace/b/24_atspecific 1.19 644)
@@ -16,56 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-## ------------------------------ ##
-## Setting up base layer macros. ##
-## ------------------------------ ##
-
include(atgeneral.m4)divert(-1)
-
-# Until the day Autotest, Ad'HoC and Autoconf share the same M4sugar, we
-# have to reinstall some m4 builtins that atgeneral.m4 undefined.
-AT_DEFINE([m4_shift],
-[builtin([shift], $@)])
-AT_DEFINE([m4_patsubst],
-[builtin([patsubst], $@)])
-AT_DEFINE([define],
-[builtin([define], $@)])
-
-
-# m4_for(VARIABLE, FROM, TO, EXPRESSION)
-# --------------------------------------
-# Expand EXPRESSION defining VARIABLE to FROM, FROM + 1, ..., TO.
-# Both limits are included.
-AT_DEFINE([m4_for],
-[pushdef([$1], [$2])_m4_for([$1], [$2], [$3], [$4])popdef([$1])])
-
-AT_DEFINE([_m4_for],
-[$4[]ifelse($1, [$3], [],
- [define([$1], incr($1))_m4_for([$1], [$2], [$3], [$4])])])
-
-
-
-# m4_foreach(VARIABLE, LIST, EXPRESSION)
-# --------------------------------------
-# Expand EXPRESSION assigning to VARIABLE each value of the LIST
-# (LIST should have the form `[(item_1, item_2, ..., item_n)]'),
-# i.e. the whole list should be *quoted*. Quote members too if
-# you don't want them to be expanded.
-#
-# This macro is robust to active symbols:
-# define(active, ACTIVE)
-# m4_foreach([Var], [([active], [b], [active])], [-Var-])end
-# => -active--b--active-end
-define(m4_foreach,
-[pushdef([$1], [])_m4_foreach($@)popdef([$1])])
-
-dnl Low level macros used to define m4_foreach
-define(m4_car, [[$1]])
-define(_m4_foreach,
-[ifelse($2, [()], ,
- [define([$1], [m4_car$2])$3[]_m4_foreach([$1],
- [(m4_shift$2)],
- [$3])])])
Index: tests/m4sh.at
--- tests/m4sh.at Sun, 12 Nov 2000 10:59:09 +0100 akim (ace/b/44_m4sh.at 1.4
644)
+++ tests/m4sh.at Sat, 18 Nov 2000 14:49:54 +0100 akim (ace/b/44_m4sh.at 1.4
644)
@@ -13,7 +13,7 @@
# Build nested dirs.
-AT_SETUP([AS_DIRNAME & AS_DIRNAME_SED])
+AT_SETUP([[AS_DIRNAME & AS_DIRNAME_SED]])
AT_DATA(configure.in,
[[define([AS_DIRNAME_TEST],
@@ -62,9 +62,9 @@
# Build nested dirs.
-AT_SETUP([AS_MKDIR_P])
+AT_SETUP([[AS_MKDIR_P]])
-AT_DATA(configure.in,
+AT_DATA([configure.in],
[[AC_PLAIN_SCRIPT
pwd=`pwd`
set -e
@@ -96,7 +96,7 @@
AT_SETUP([Negated classes in globbing])
-AT_DATA(configure.in,
+AT_DATA([configure.in],
[[AC_PLAIN_SCRIPT
case 'with!two!bangs' in
*[[!a-z]]*) ;;
Index: tests/m4sugar.at
--- tests/m4sugar.at Sat, 11 Nov 2000 16:02:51 +0100 akim (ace/b/45_m4sugar.at
1.4 644)
+++ tests/m4sugar.at Sat, 18 Nov 2000 14:44:02 +0100 akim (ace/b/45_m4sugar.at
1.4 644)
@@ -10,7 +10,7 @@
## m4_text_wrap. ##
## -------------- ##
-AT_SETUP(m4_text_wrap)
+AT_SETUP([[m4_text_wrap]])
# m4_text_wrap is used to display the help strings. Also, check that
# commas are not swallowed. This can easily happen because of
@@ -59,7 +59,7 @@
## m4_warn. ##
## --------- ##
-AT_SETUP([m4_warn])
+AT_SETUP([[m4_warn]])
# m4_text_wrap is used to display the help strings. Also, check that
# commas are not swallowed. This can easily happen because of
Index: tests/torture.at
--- tests/torture.at Sat, 18 Nov 2000 12:03:30 +0100 akim (ace/b/26_torture.m4
1.16 644)
+++ tests/torture.at Sat, 18 Nov 2000 14:56:43 +0100 akim (ace/b/26_torture.m4
1.16 644)
@@ -212,10 +212,10 @@
dnl The value used as a big value for AC_DEFINE.
dnl Don't use sh active chars here, below it is also used in a sh
dnl assignment.
-define([Big_Value],
+m4_define([Big_Value],
[This value should be long enough to torture the various limits of sed and
other tools used by Autoconf.])
-define([DEFINE_Description],
+m4_define([DEFINE_Description],
[Define to a long string if your `Autoconf' works properly.])
@@ -229,7 +229,7 @@
# 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.*.
-define([AT_DUMMY_VAR],
+m4_define([AT_DUMMY_VAR],
[ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
dnl This call was quite delicate to write because we didn't want to
@@ -239,23 +239,23 @@
AT_SETUP([Torturing config.status])
-AT_DATA(dummy.in,
-[m4_for(AT_Count, 1, 100,
+AT_DATA([dummy.in],
+[m4_for([AT_Count], 1, 100, 1,
address@hidden(AT_Count)@
])])
AT_DATA(configure.in,
-[AC_INIT
+[[AC_INIT
AC_CONFIG_HEADERS(config.h:config.hin)
AC_CONFIG_FILES(dummy)
-[define]([AC_DEFUBST_VALUE], Big_Value)
+m4_define]([AC_DEFUBST_VALUE], Big_Value)
dnl The following 4 lines are a transfert from AT_DUMMY_VAR in Autotest
dnl to AC_DUMMY_VAR in Autoconf.
-[define]([AC_DUMMY_VAR],
-changequote({{, }})dnl
-[defn({{AT_DUMMY_VAR}})]dnl
-changequote([, ]))
-m4_for(AT_Count, 1, 100,
+[m4_define]([AC_DUMMY_VAR],
+m4_changequote({{, }})dnl
+[m4_defn({{AT_DUMMY_VAR}})]dnl
+m4_changequote([, ]))
+m4_for(AT_Count, 1, 100, 1,
[AC_DEFUBST(AT_Count)
])
AC_OUTPUT
@@ -267,7 +267,7 @@
# Checking that AC_DEFINE worked properly.
AT_DATA(expout,
-[m4_for(AT_Count, 1, 100,
+[m4_for(AT_Count, 1, 100, 1,
[
/* DEFINE_Description */
[#define] AT_DUMMY_VAR(AT_Count) "Big_Value"
@@ -276,7 +276,7 @@
# Checking that AC_SUBST worked properly.
AT_DATA(expout,
-[m4_for(AT_Count, 1, 100,
+[m4_for(AT_Count, 1, 100, 1,
[Big_Value
])])
Index: tests/base.at
--- tests/base.at Fri, 03 Nov 2000 20:58:02 +0100 akim (ace/b/29_base.m4 1.12
644)
+++ tests/base.at Sat, 18 Nov 2000 15:15:51 +0100 akim (ace/b/29_base.m4 1.12
644)
@@ -18,7 +18,7 @@
AT_DATA(configure.in,
[[define([REQUIRE_AND_CHECK],
[AC_REQUIRE([$1])dnl
-test -z "$translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
+test -z "$m4_translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
AC_DEFUN([TEST1],
[REQUIRE_AND_CHECK([TEST2a])
- 30-autom4te-autotest.patch,
DEMAILLE Akim <=