[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: 13-adj-autotest.patch
From: |
Akim Demaille |
Subject: |
FYI: 13-adj-autotest.patch |
Date: |
05 Oct 2001 09:54:47 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* tests/Makefile.am: Adjust for gnuprog2.
* tests/m4.in: There can be a leading path.
* tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
* tests/testsuite.at: Adjust to the most recent Autotest.
(AT_CHECK_M4_FILTER): Fix and rename as...
(AT_TEST_M4): this.
* tests/others.at: Use it.
Index: tests/Makefile.am
--- tests/Makefile.am Mon, 01 Oct 2001 16:22:19 +0200 akim
+++ tests/Makefile.am Wed, 03 Oct 2001 21:54:57 +0200 akim
@@ -39,9 +39,12 @@ check-local: atconfig $(TESTSUITE)
clean-local:
$(srcdir)/testsuite --clean
-$(srcdir)/generated.at: $(srcdir)/generate.awk $(top_srcdir)/doc/m4.texinfo
- rm -f $@ address@hidden
- $(AWK) -f $(srcdir)/generate.awk $(top_srcdir)/doc/m4.texinfo
>address@hidden
+# Using variables so that this snippet is not too wide and can
+# be used as is in Texinfo @example/@end example.
+m4_texinfo = $(top_srcdir)/doc/m4.texinfo
+generate = $(AWK) -f $(srcdir)/generate.awk
+$(srcdir)/generated.at: $(srcdir)/generate.awk $(m4_texinfo)
+ $(generate) $(m4_texinfo) >address@hidden
mv address@hidden $@
AUTOM4TE = autom4te
Index: tests/m4.in
--- tests/m4.in Mon, 01 Oct 2001 16:22:19 +0200 akim
+++ tests/m4.in Tue, 02 Oct 2001 20:56:05 +0200 akim
@@ -1,5 +1,5 @@
#! /bin/sh
-# @configure_generated@
+# @configure_input@
# Wrapper around a non installed m4 to make it work as an installed one.
"@top_buildpath@/src/m4" \
@@ -7,7 +7,13 @@
${1+"$@"} 2>/tmp/m4-$$
status=$?
# Normalize stderr.
-sed 's,^[lt-]*m4[.ex]*:,m4:,' /tmp/m4-$$ >&2
+# - If configure --disable-shared, then src/m4 is a real program,
+# neutralize the full path display
+# - otherwise, it is a libtool wrapper, relying on PATH to execute the
+# actual program, either lt-m4, or m4.
+#
+# - In both cases, beware of .exe.
+sed 's,^[^:]*[lt-]*m4[.ex]*:,m4:,' /tmp/m4-$$ >&2
rm /tmp/m4-$$
exit $status
Index: tests/modules.at
--- tests/modules.at Mon, 01 Oct 2001 16:26:15 +0200 akim
+++ tests/modules.at Wed, 03 Oct 2001 21:30:57 +0200 akim
@@ -70,9 +70,9 @@
## Exercising the test module. ##
## ---------------------------- ##
-# AT_CHECK_M4_MODTEST(TITLE, ENV-VARS, M4-OPTIONS, [STDOUT], [STDERR])
-# --------------------------------------------------------------------
-# Skip this test if modtest is not present (we are not in the build tree).
+# AT_CHECK_M4_MODTEST(TITLE, ENV-VARS, M4-OPTIONS)
+# ------------------------------------------------
+# Skip if modtest is not present (we are not in the package).
m4_define([AT_CHECK_M4_MODTEST],
[AT_SETUP([$1])
AT_KEYWORDS([module])
@@ -89,20 +89,18 @@ Dumpdef: dumpdef(`test').
]])
AT_CHECK([$2 m4 -m load -d input.m4 $3], 0,
- m4_default([$4],
[[
Test module called.
Dumpdef: .
test
Dumpdef: .
-]]),
- m4_default([$5],
+]],
[[Test module loaded.
test: <test>
Test module unloaded.
m4: input.m4: 6: Warning: dumpdef: undefined name: test
-]]))
+]])
AT_CLEANUP
])
@@ -115,17 +113,18 @@ m4: input.m4: 6: Warning: dumpdef: undef
AT_CHECK_M4_MODTEST([--module-directory: relative path],
[], [-M $top_builddir/modules])
+AT_CHECK_M4_MODTEST([M4MODPATH: absolute path],
+ [M4MODPATH=$top_buildpath/modules], [])
+
+AT_CHECK_M4_MODTEST([M4MODPATH: relative path],
+ [M4MODPATH=$top_builddir/modules], [])
+
AT_CHECK_M4_MODTEST([LTDL_LIBRARY_PATH: absolute path],
[LTDL_LIBRARY_PATH=$top_buildpath/modules], [])
AT_CHECK_M4_MODTEST([LTDL_LIBRARY_PATH: relative path],
[LTDL_LIBRARY_PATH=$top_builddir/modules], [])
-AT_CHECK_M4_MODTEST([M4MODPATH: absolute path],
- [M4MODPATH=$top_buildpath/modules], [])
-
-AT_CHECK_M4_MODTEST([M4MODPATH: relative path],
- [M4MODPATH=$top_builddir/modules], [])
Index: tests/others.at
--- tests/others.at Tue, 28 Aug 2001 18:40:09 +0200 akim
+++ tests/others.at Wed, 03 Oct 2001 20:59:05 +0200 akim
@@ -23,9 +23,7 @@
## capitalize ##
## ---------- ##
-AT_SETUP([capitalize])
-
-AT_DATA([[capitalize.m4]],
+AT_TEST_M4([Capitalize],
[[dnl
dnl convert to upper- resp. lowercase
define(`upcase', `translit(`$*', `a-z', `A-Z')')
@@ -37,9 +35,7 @@
define(`capitalize1', `regexp(`$1', `^\(\w\)\(\w*\)',
`upcase(`\1')`'downcase(`\2')')')
define(`capitalize', `patsubst(`$1', `\w+', ``'capitalize1(`\&')')')
capitalize(`This sentence should be capitalized')
-]])
-
-AT_CHECK_M4([capitalize.m4], 0,
+]],
[[
CONVERT TO UPPER CASE
@@ -49,17 +45,13 @@
This Sentence Should Be Capitalized
]])
-AT_CLEANUP
-
## -------- ##
## comments ##
## -------- ##
-AT_SETUP([comments])
-
-AT_DATA([[comments.m4]],
+AT_TEST_M4([Comments],
[[# An ordinary comment
define(`foo', # A comment in a macro
`Macro `foo' expansion')
@@ -67,9 +59,7 @@
define(`comment', `*** Macro `comment' expansion ***')
changecom(`@', `@')
foo
-]])
-
-AT_CHECK_M4([comments.m4], 0,
+]],
[[# An ordinary comment
# A comment in a macro
@@ -79,8 +69,6 @@
# A *** Macro comment expansion *** in a macro
Macro foo expansion
]])
-
-AT_CLEANUP
Index: tests/testsuite.at
--- tests/testsuite.at Mon, 01 Oct 2001 16:22:19 +0200 akim
+++ tests/testsuite.at Wed, 03 Oct 2001 21:56:49 +0200 akim
@@ -1,4 +1,4 @@
-# Process this file with autom4te to create testsuite. -*- Autotest -*-
+# Process with autom4te to create an -*- Autotest -*- test suite.
# Test suite for GNU M4.
# Copyright 2001 Free Software Foundation, Inc.
@@ -19,34 +19,29 @@
# 02111-1307, USA.
# We need a recent Autotest.
-m4_version_prereq([2.52c])
+m4_version_prereq([2.52e])
-# AT_CHECK_M4(ARGS, [EXIT-STATUS], [STDOUT], [STDERR])
-# ----------------------------------------------------
-# Hide the impact of libtool on program_invocation_name, and hide
-# the differences of paths when src != build.
+# AT_CHECK_M4(ARGS, [EXIT-STATUS = 0], [STDOUT = `'], [STDERR = `'])
+# ------------------------------------------------------------------
m4_define([AT_CHECK_M4],
[AT_CHECK([m4 -b -d $1], [$2], [$3], [$4])
])
-
-# AT_CHECK_M4_FILTER(TITLE, INPUT, [STDOUT], [STDERR])
-# ----------------------------------------------------
-# Hide the impact of libtool on program_invocation_name, and hide
-# the differences of paths when src != build.
-m4_define([AT_CHECK_M4_FILTER],
+# AT_TEST_M4(TITLE, INPUT, [STDOUT = `'], [STDERR = `'])
+# ------------------------------------------------------
+# Run m4 on INPUT, expecting a success.
+m4_define([AT_TEST_M4],
[AT_SETUP([$1])
-AT_DATA([[in.m4]], [$2])
-AT_CHECK_M4([[in.m4]], 0, [$4], [$5])
+AT_DATA([[input.m4]], [$2])
+AT_CHECK_M4([[input.m4]], 0, [$3], [$4])
AT_CLEANUP
])
-
# We use `dnl' in zillions of places...
m4_pattern_allow([^dnl$])
# We exercise m4.
-AT_VICTIMS([m4])
+AT_TESTED([m4])
## ----------- ##
## The suite. ##
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: 13-adj-autotest.patch,
Akim Demaille <=