m4-patches
[Top][All Lists]
Advanced

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

23-fyi-simplify-tests-m4.patch


From: Akim Demaille
Subject: 23-fyi-simplify-tests-m4.patch
Date: Wed, 29 Aug 2001 11:07:10 +0200

Gary, I think I understand that the [^:]* part in tests/m4 corresponds
to invocations with a path, right?  But this cannot happen since the
test suite relies upon PATH, so we can get rid of it, can't we?

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
        handle that.
        * tests/others.at (wrap): Inline wrap.m4.
        (shadow): Inline shadow.m4.
        (iso8859): Don't specify the path from top_srcdir, but from srcdir.
        * tests/m4: Simplify.

Index: tests/m4
--- tests/m4 Sat, 25 Aug 2001 11:24:47 +0200 akim
+++ tests/m4 Tue, 28 Aug 2001 17:00:53 +0200 akim
@@ -1,16 +1,12 @@
 #! /bin/sh
-
 # Wrapper around a non installed m4 to make it work as an installed one.
-
 . ./atconfig
-test -f atlocal && . ./atlocal

 ${SHELL} $top_builddir/libtool --mode=execute \
          $top_builddir/src/m4 -M $top_builddir/modules ${1+"$@"} 2>/tmp/m4-$$
 status=$?
-
 # Normalize stderr.
-sed 's,^[^:]*[lt-]*m4[.ex]*:,m4:,;s,m4: ../../,m4: ../,' /tmp/m4-$$ >&2
+sed 's,^[^:]*[lt-]*m4[.ex]*:,m4:,' /tmp/m4-$$ >&2
 rm /tmp/m4-$$

 exit $status
Index: tests/others.at
--- tests/others.at Sat, 25 Aug 2001 10:56:35 +0200 akim
+++ tests/others.at Tue, 28 Aug 2001 17:42:29 +0200 akim
@@ -705,7 +705,7 @@ m4: include.m4: 6: Cannot open NOFILE: N
 This will be seen.
 ]])

-AT_CHECK_M4([tests/iso8859.m4], 0, expout)
+AT_CHECK_M4([$srcdir/iso8859.m4], 0, expout)

 AT_CLEANUP

@@ -1130,6 +1130,62 @@ m4trace: -1- regexp(`hej med dig', `m\(.

 AT_SETUP([shadow])

+AT_DATA([[shadow.m4]],
+[[# no modules loaded yet
+test
+shadow
+
+# define our own macros for `test' and `shadow'
+define(`test', `local::`test'')
+define(`shadow', `local::`shadow'')
+test
+shadow
+
+# module Shadow defines `shadow' and `test' macros
+load(`shadow')
+dumpdef(`test')
+dumpdef(`shadow')
+test
+shadow
+
+# save the definition of `test' from the Shadow module
+define(`Shadow::test', defn(`test'))
+
+# module Test also defines a `test' macro
+load(`modtest')
+dumpdef(`test')
+dumpdef(`shadow')
+test
+shadow
+
+# Reloading Shadow shouldn't affect anything
+load(`shadow')
+dumpdef(`test')
+dumpdef(`shadow')
+test
+shadow
+
+# Unloading Test will unshadow the test definition in Shadow
+unload(`modtest')
+dumpdef(`test')
+dumpdef(`shadow')
+test
+shadow
+
+# Unloading Shadow once has no effect (we loaded it twice)
+unload(`shadow')
+dumpdef(`test')
+dumpdef(`shadow')
+test
+shadow
+
+# Unloading Shadow again will revert to copying `test' and the local
+# `shadow' macro.
+unload(`shadow')
+test
+shadow
+]])
+
 AT_DATA([[expout]],
 [[# no modules loaded yet
 test
@@ -1199,7 +1255,7 @@ test:     <test>
 shadow:        <shadow>
 ]])

-AT_CHECK_M4([-m load modules/shadow.m4], 0,
+AT_CHECK_M4([-m load shadow.m4], 0,
             [expout], [experr])

 AT_CLEANUP
@@ -1582,7 +1638,20 @@ Shadow::test called.

 AT_SETUP([wrap])

-AT_CHECK_M4([examples/wrap.m4], 0,
+AT_DATA([[wrap.m4]],
+[[divert(-1)
+m4wrap(`Wrapper no. 1
+')
+
+m4wrap(`Wrapper no. 2
+m4wrap(`Wrapper no. 3
+m4wrap(`Wrapper no. 4
+')')')
+divert
+No. 33: The End.
+]])
+
+AT_CHECK_M4([wrap.m4], 0,
 [[
 No. 33: The End.
 Wrapper no. 2
Index: tests/testsuite.at
--- tests/testsuite.at Sat, 25 Aug 2001 11:24:47 +0200 akim
+++ tests/testsuite.at Tue, 28 Aug 2001 17:33:39 +0200 akim
@@ -26,7 +26,7 @@
 # Hide the impact of libtool on program_invocation_name, and hide
 # the differences of paths when src != build.
 m4_define([AT_CHECK_M4],
-[AT_CHECK([m4 -I $top_srcdir -b -d $1],
+[AT_CHECK([m4 -b -d $1],
           [$2], [$3], [$4])
 ])



reply via email to

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