[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
52-at-to-m4.patch
From: |
Akim Demaille |
Subject: |
52-at-to-m4.patch |
Date: |
Tue, 28 Nov 2000 09:04:53 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* tests/atgeneral.m4 (AT_DEFINE, AT_UNDEFINE, AT_SHIFT)
(AT_INCLUDE): Remove, use the m4_ macros.
Index: m4sugar.m4
--- m4sugar.m4 Sun, 26 Nov 2000 17:18:55 +0100 akim (ace/b/27_libm4.m4 1.40 644)
+++ m4sugar.m4 Sun, 26 Nov 2000 17:22:40 +0100 akim (ace/b/27_libm4.m4 1.40 644)
@@ -177,8 +177,8 @@ m4_define([m4_fatal],
m4_exit(ifelse([$2],, 1, [$2]))])
-# m4_assert( EXPRESSION [, EXIT-STATUS = 1 ])
-# -------------------------------------------
+# m4_assert(EXPRESSION, [EXIT-STATUS = 1])
+# ----------------------------------------
# This macro ensures that EXPRESSION evaluates to true, and exits if
# EXPRESSION evaluates to false.
m4_define([m4_assert],
Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Sun, 19 Nov 2000 15:53:46 +0100 akim
(ace/b/19_atgeneral. 1.34 644)
+++ tests/atgeneral.m4 Sun, 26 Nov 2000 17:59:22 +0100 akim
(ace/b/19_atgeneral. 1.34 644)
@@ -46,13 +46,6 @@
# version.
-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:
#
# - DEFAULT
@@ -90,7 +83,7 @@ m4_define([_m4_divert(TEST)], 100
# AT_LINE
# -------
# Return the current file sans directory, a colon, and the current line.
-AT_DEFINE([AT_LINE],
+m4_define([AT_LINE],
[m4_patsubst(__file__, ^.*/\(.*\), \1):__line__])
@@ -98,8 +91,8 @@ m4_define([_m4_divert(TEST)], 100
# ----------------
# Begin testing suite, using PROGRAM to check version. The search path
# should be already preset so the proper executable will be selected.
-AT_DEFINE([AT_INIT],
-[AT_DEFINE([AT_ordinal], 0)
+m4_define([AT_INIT],
+[m4_define([AT_ordinal], 0)
m4_divert_push([DEFAULT])dnl
#! /bin/sh
@@ -132,7 +125,8 @@ m4_define([_m4_divert(TEST)], 100
at_help=false
# Tests to run
at_tests=
-m4_divert([OPTIONS])dnl Other vars inserted here.
+dnl Other vars inserted here (DEFAULT).
+m4_divert([OPTIONS])
while test $[#] -gt 0; do
case $[1] in
@@ -228,6 +222,7 @@ m4_define([_m4_divert(TEST)], 100
do
at_status=0;
case $at_test in
+dnl Tests inserted here (TESTS).
m4_divert([TAIL])[]dnl
esac
at_test_count=`expr 1 + $at_test_count`
@@ -310,8 +305,8 @@ m4_define([_m4_divert(TEST)], 100
# ---------------------
# 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],
-[m4_define([AT_ordinal], m4_eval(AT_ordinal + 1))
+m4_define([AT_SETUP],
+[m4_define([AT_ordinal], m4_incr(AT_ordinal))
m4_divert_text([HELP],
[m4_format([ %3d: %-15s %s], AT_ordinal, AT_LINE, [$1])])
m4_pushdef([AT_data_files], [stdout stderr ])
@@ -335,7 +330,7 @@ m4_define([_m4_divert(TEST)], 100
# AT_CLEANUP_FILE_IFELSE(FILE, IF-REGISTERED, IF-NOT-REGISTERED)
# --------------------------------------------------------------
-AT_DEFINE([AT_CLEANUP_FILE_IFELSE],
+m4_define([AT_CLEANUP_FILE_IFELSE],
[ifelse(m4_regexp(AT_data_files, m4_patsubst([ $1 ], [\([\[\]*.]\)], [\\\1])),
-1,
[$3], [$2])])
@@ -344,7 +339,7 @@ m4_define([_m4_divert(TEST)], 100
# AT_CLEANUP_FILE(FILE)
# ---------------------
# Register FILE for AT_CLEANUP.
-AT_DEFINE([AT_CLEANUP_FILE],
+m4_define([AT_CLEANUP_FILE],
[AT_CLEANUP_FILE_IFELSE([$1], [],
[m4_append([AT_data_files], [$1 ])])])
@@ -352,7 +347,7 @@ m4_define([_m4_divert(TEST)], 100
# AT_CLEANUP_FILES(FILES)
# -----------------------
# Declare a list of FILES to clean.
-AT_DEFINE([AT_CLEANUP_FILES],
+m4_define([AT_CLEANUP_FILES],
[m4_foreach([AT_File], m4_quote(m4_patsubst([$1], [ *], [,])),
[AT_CLEANUP_FILE(AT_File)])])
@@ -362,7 +357,7 @@ m4_define([_m4_divert(TEST)], 100
# Complete a group of related tests, recursively remove those FILES
# created within the test. There is no need to list stdout, stderr,
# nor files created with AT_DATA.
-AT_DEFINE([AT_CLEANUP],
+m4_define([AT_CLEANUP],
[AT_CLEANUP_FILES([$1])dnl
$at_traceoff
)
@@ -382,7 +377,7 @@ m4_define([_m4_divert(TEST)], 100
# an end of line.
# This macro is not robust to active symbols in CONTENTS *on purpose*.
# If you don't want CONTENT to be evaluated, quote it twice.
-AT_DEFINE([AT_DATA],
+m4_define([AT_DATA],
[AT_CLEANUP_FILES([$1])dnl
cat >$1 <<'_ATEOF'
$2[]_ATEOF
@@ -400,14 +395,14 @@ m4_define([_m4_divert(TEST)], 100
# STATUS is not checked if it is empty.
# STDOUT and STDERR can be the special value `ignore', in which case
# their content is not checked.
-AT_DEFINE([AT_CHECK],
+m4_define([AT_CHECK],
[$at_traceoff
$at_verbose "$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
$1
-ifelse([$2], [], [],
+m4_ifval([$2],
[at_status=$?
if test $at_status != $2; then
$at_verbose "Exit code was $at_status, expected $2" >&6
Index: tests/atspecific.m4
--- tests/atspecific.m4 Sun, 19 Nov 2000 15:34:26 +0100 akim
(ace/b/24_atspecific 1.24 664)
+++ tests/atspecific.m4 Sun, 26 Nov 2000 17:59:34 +0100 akim
(ace/b/24_atspecific 1.24 664)
@@ -1,5 +1,5 @@
-divert(-1) -*- Autoconf -*-
-# `m4' macros used in building Autoconf test suites.
+include(atgeneral.m4) -*- Autoconf -*-
+# M4 macros used in building Autoconf test suites.
# 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
@@ -16,9 +16,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-include(atgeneral.m4)m4_divert(-1)
-
-
## ---------------------------------------- ##
## Macros specialized in testing Autoconf. ##
@@ -27,21 +24,21 @@
# AT_CHECK_AUTOCONF
# -----------------
-AT_DEFINE([AT_CHECK_AUTOCONF],
+m4_define([AT_CHECK_AUTOCONF],
[AT_CLEANUP_FILES(configure)dnl
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])])
# AT_CHECK_AUTOHEADER
# -------------------
-AT_DEFINE([AT_CHECK_AUTOHEADER],
+m4_define([AT_CHECK_AUTOHEADER],
[AT_CLEANUP_FILES(config.hin)dnl
AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])])
# AT_CHECK_CONFIGURE
# -------------------
-AT_DEFINE([AT_CHECK_CONFIGURE],
+m4_define([AT_CHECK_CONFIGURE],
[AT_CLEANUP_FILE_IFELSE([config.hin],
[AT_CLEANUP_FILE(config.h)])dnl
AT_CLEANUP_FILES(config.log config.status config.cache)dnl
@@ -56,7 +53,7 @@
# and that the shell runs correctly the configure.
# TOP_SRCDIR is needed to set the auxdir (some macros need `install-sh',
# `config.guess' etc.).
-AT_DEFINE([_AT_CHECK_AC_MACRO],
+m4_define([_AT_CHECK_AC_MACRO],
[dnl Produce the configure.in
AT_CLEANUP_FILES(env-after state*)dnl
AT_DATA([configure.in],
@@ -91,7 +88,7 @@
# and that the shell runs correctly the configure.
# TOP_SRCDIR is needed to set the auxdir (some macros need `install-sh',
# `config.guess' etc.).
-AT_DEFINE([AT_CHECK_MACRO],
+m4_define([AT_CHECK_MACRO],
[AT_SETUP([$1])
_AT_CHECK_AC_MACRO([ifelse([$2],,[$1], [$2])])
@@ -107,7 +104,7 @@
# on that script, and that the shell runs correctly the configure.
# TOP_SRCDIR is needed to set the auxdir (some macros need
# `install-sh', `config.guess' etc.).
-AT_DEFINE([AT_CHECK_UPDATE],
+m4_define([AT_CHECK_UPDATE],
[AT_SETUP([the autoupdating of $1])
_AT_CHECK_AC_MACRO([$1],
@@ -125,5 +122,5 @@
# Stripping consists of keeping CPP lines (i.e. containing a hash),
# but those of automatically checked features (STDC_HEADERS etc.).
# AT_CHECK_HEADER is a better name, but too close from AC_CHECK_HEADER.
-AT_DEFINE(AT_CHECK_DEFINES,
+m4_define([AT_CHECK_DEFINES],
[AT_CHECK([[fgrep '#' config.h | grep -v 'STDC_HEADERS']],, [$1])])
Index: tests/semantics.at
--- tests/semantics.at Sat, 18 Nov 2000 19:19:30 +0100 akim
(ace/b/25_semantics. 1.25 644)
+++ tests/semantics.at Sun, 26 Nov 2000 18:02:12 +0100 akim
(ace/b/25_semantics. 1.25 644)
@@ -28,7 +28,7 @@
# in libm. Nor can I imagine a lib more likely to exists than libm.
# But there are systems without libm, on which we don't want to have
# this test fail, so exit successfully if `cos' is in libc.
-AT_CHECK_MACRO(AC_CHECK_LIB,
+AT_CHECK_MACRO([AC_CHECK_LIB],
[AC_TRY_LINK_FUNC(cos, [AS_EXIT(0)])
AC_CHECK_LIB(m, cos,,
[AC_MSG_ERROR([cannot find `cos'])])])
@@ -38,7 +38,7 @@
# --------------
# Check that it performs the correct actions:
# Must define NEED_NO_DECL, but not NEED_YES_DECL.
-AT_CHECK_MACRO(AC_CHECK_DECLS,
+AT_CHECK_MACRO([AC_CHECK_DECLS],
[[AC_CHECK_DECLS([yes, no],,,
[int yes = 1;])]],
[AT_CHECK_DEFINES(
@@ -76,7 +76,7 @@
# ----------------
# Check that it performs the correct actions:
# Must define HAVE_STDIO_H, but not HAVE_AUTOCONF_IO_H.
-AT_CHECK_MACRO(AC_CHECK_HEADERS,
+AT_CHECK_MACRO([AC_CHECK_HEADERS],
[AC_CHECK_HEADERS(stdio.h autoconf_io.h)],
[AT_CHECK_DEFINES(
[/* #undef HAVE_AUTOCONF_IO_H */
@@ -89,7 +89,7 @@
# ----------------
# Check that it performs the correct actions.
# Must define HAVE_STRUCT_YES_S_YES, but not HAVE_STRUCT_YES_S_NO.
-AT_CHECK_MACRO(AC_CHECK_MEMBERS,
+AT_CHECK_MACRO([AC_CHECK_MEMBERS],
[[AC_CHECK_MEMBERS([struct yes_s.yes, struct yes_s.no],,,
[struct yes_s { int yes ;} ;])]],
[AT_CHECK_DEFINES(
@@ -100,7 +100,7 @@
# AC_CHECK_SIZEOF
# ---------------
-AT_CHECK_MACRO(AC_CHECK_SIZEOF,
+AT_CHECK_MACRO([AC_CHECK_SIZEOF],
[AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(charchar,,
[#include <stdio.h>
@@ -138,7 +138,7 @@
# Must define HAVE_STRUCT_YES_S, HAVE_INT, but not HAVE_STRUCT_NO_S.
# `int' and `struct yes_s' are both checked to test both the compiler
# builtin types, and defined types.
-AT_CHECK_MACRO(AC_CHECK_TYPES,
+AT_CHECK_MACRO([AC_CHECK_TYPES],
[[AC_CHECK_TYPES([int, struct yes_s, struct no_s],,,
[struct yes_s { int yes ;} ;])]],
[AT_CHECK_DEFINES(
@@ -192,7 +192,7 @@
# --------------
# FIXME: To really test HAVE_AC_EXISTS2 and HAVE_AC_MISSING2 we need to
# open AH_TEMPLATE to `configure.in', which is not yet the case.
-AT_CHECK_MACRO(AC_CHECK_FILES,
+AT_CHECK_MACRO([AC_CHECK_FILES],
[touch ac-exists1 ac-exists2
ac_exists2=ac-exists2
ac_missing2=ac-missing2
@@ -214,7 +214,7 @@
# ----------------------
# Create a sub directory `path' with 6 subdirs which all 7 contain
# an executable `tool'. `6' contains a `better' tool.
-AT_DEFINE([AT_CHECK_PROGS_PREPARE],
+m4_define([AT_CHECK_PROGS_PREPARE],
[mkdir path
cat >path/tool <<\EOF
@@ -235,7 +235,7 @@
# AC_CHECK_PROG & AC_CHECK_PROGS. #
# -------------------------------- #
-AT_SETUP(AC_CHECK_PROG & AC_CHECK_PROGS)
+AT_SETUP([AC_CHECK_PROG & AC_CHECK_PROGS])
AT_CHECK_PROGS_PREPARE
Index: tests/suite.at
--- tests/suite.at Sun, 19 Nov 2000 15:34:26 +0100 akim (ace/b/20_suite.m4 1.15
644)
+++ tests/suite.at Sun, 26 Nov 2000 17:24:41 +0100 akim (ace/b/20_suite.m4 1.15
644)
@@ -17,32 +17,32 @@
# the most selective to the easiest.
# M4sugar.
-AT_INCLUDE([m4sugar.at])
+m4_include([m4sugar.at])
# M4sh.m4.
-AT_INCLUDE([m4sh.at])
+m4_include([m4sh.at])
# Autoconf base macros.
-AT_INCLUDE([base.at])
+m4_include([base.at])
# The executables.
-AT_INCLUDE([tools.at])
+m4_include([tools.at])
# Testing config.status
# ---------------------
# Actually should be named config.status.at but I fear problems with
# the name. Does no `checking...' at all, but exercises only code
# which following section use too. Hence, run it first.
-AT_INCLUDE([torture.at])
+m4_include([torture.at])
# Checking AC_PROG_CC, AC_COMPILE_IFELSE etc.
-AT_INCLUDE([compile.at])
+m4_include([compile.at])
# Checking that AC_CHECK_FOO macros work properly.
-AT_INCLUDE([semantics.at])
+m4_include([semantics.at])
# Checking all the AC_DEFUN'd macros.
-AT_INCLUDE([syntax.at])
+m4_include([syntax.at])
# Checking that updating an obsolete macro produces a valid configure.in
-AT_INCLUDE([update.at])
+m4_include([update.at])
- 52-at-to-m4.patch,
Akim Demaille <=