m4-patches
[Top][All Lists]
Advanced

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

FYI: Improve others.at


From: Akim Demaille
Subject: FYI: Improve others.at
Date: 17 Aug 2001 16:19:32 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Making the handling of M4PATH more regular, and more readable.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
        * tests/others.at: Adjust input files paths.
        * tests/atconfig.in: Set top_builddir.
        * tests/Makefile.am: Adjust.
        `testsuite' is in src, not build.

Index: tests/Makefile.am
===================================================================
RCS file: /cvs/m4/tests/Makefile.am,v
retrieving revision 1.12
diff -u -u -r1.12 Makefile.am
--- tests/Makefile.am 2001/08/17 13:02:15 1.12
+++ tests/Makefile.am 2001/08/17 14:11:52
@@ -33,7 +33,7 @@
 TESTSUITE = testsuite
 
 check-local: atconfig $(TESTSUITE)
-       top_builddir=$(top_builddir) $(SHELL) $(TESTSUITE)
+       $(SHELL) $(srcdir)/$(TESTSUITE)
 
 $(srcdir)/generated.at: $(srcdir)/generate.awk $(top_srcdir)/doc/m4.texinfo
 # FIXME: Stupid Akim TM forgot to bring generate.awk...
Index: tests/atconfig.in
===================================================================
RCS file: /cvs/m4/tests/atconfig.in,v
retrieving revision 1.1
diff -u -u -r1.1 atconfig.in
--- tests/atconfig.in 2001/08/17 13:02:15 1.1
+++ tests/atconfig.in 2001/08/17 14:11:52
@@ -58,7 +58,7 @@
 
 srcdir='@srcdir@'
 top_srcdir='@top_srcdir@'
-: ${top_builddir=$top_srcdir}
+top_builddir='..'
 AUTOTEST_PATH='../bin'
 
 SHELL=${CONFIG_SHELL-'/bin/sh'}
Index: tests/others.at
===================================================================
RCS file: /cvs/m4/tests/others.at,v
retrieving revision 1.1
diff -u -u -r1.1 others.at
--- tests/others.at 2001/08/17 11:58:27 1.1
+++ tests/others.at 2001/08/17 14:11:52
@@ -26,7 +26,7 @@
 
 AT_SETUP([capitalize])
 
-AT_CHECK_M4([../examples/capitalize.m4], 0,
+AT_CHECK_M4([examples/capitalize.m4], 0,
 [[
 
 CONVERT TO UPPER CASE
@@ -56,7 +56,7 @@
 1
 ]])
 
-AT_CHECK([$M4 -M ../../modules -m changeword -d in], 0,
+AT_CHECK_M4([in], 0,
 [[
 1
 
@@ -74,7 +74,7 @@
 
 AT_SETUP([comments])
 
-AT_CHECK_M4([../examples/comments.m4], 0,
+AT_CHECK_M4([examples/comments.m4], 0,
 [[# An ordinary comment
 
 # A comment in a macro
@@ -95,7 +95,7 @@
 
 AT_SETUP([ddivert])
 
-AT_CHECK_M4([../examples/ddivert.m4], 0,
+AT_CHECK_M4([examples/ddivert.m4], 0,
 [[Text diverted a first time.
 Text diverted a second time.
 ]])
@@ -129,7 +129,7 @@
 m4trace: -1- countdown(...) -> `0 ifelse(eval(0 > 0), 1, `countdown(decr(0))', 
`Liftoff')'
 ]])
 
-AT_CHECK_M4([../examples/debug.m4], 0, expout, experr)
+AT_CHECK_M4([examples/debug.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -151,7 +151,7 @@
  --> ends.
 ]])
 
-AT_CHECK([$M4 -c -M ../../modules -d in], 0,
+AT_CHECK_M4([in], 0,
 [[This is not a comment This should not disappear.
 
 html  ends.
@@ -167,7 +167,7 @@
 
 AT_SETUP([esyscmd])
 
-AT_CHECK_M4([../examples/esyscmd.m4], 0,
+AT_CHECK_M4([examples/esyscmd.m4], 0,
 [[# Cannot use real hostname program because test would fail
 hostname = >>www.gnu.org
 <<
@@ -184,7 +184,7 @@
 
 AT_SETUP([exp])
 
-AT_CHECK_M4([../examples/exp.m4], 0,
+AT_CHECK_M4([examples/exp.m4], 0,
 [[7
 6
 5
@@ -206,7 +206,7 @@
 
 AT_SETUP([foreach])
 
-AT_CHECK_M4([../examples/foreach.m4], 0,
+AT_CHECK_M4([examples/foreach.m4], 0,
 [[
 Word was: foo
 Word was: bar
@@ -240,7 +240,7 @@
 
 AT_SETUP([forloop])
 
-AT_CHECK_M4([../examples/forloop.m4], 0,
+AT_CHECK_M4([examples/forloop.m4], 0,
 [[
 2**1 = 2
 2**2 = 4
@@ -265,7 +265,7 @@
 
 AT_SETUP([fstab])
 
-AT_CHECK_M4([../examples/fstab.m4], 0,
+AT_CHECK_M4([examples/fstab.m4], 0,
 [[
 
 
@@ -406,7 +406,7 @@
 
 ]])
 
-AT_CHECK([$M4 -M ../../modules -m mpeval -d in], 0, expout)
+AT_CHECK_M4([-m mpeval in], 0, expout)
 
 AT_CLEANUP
 
@@ -418,7 +418,7 @@
 
 AT_SETUP([hanoi])
 
-AT_CHECK_M4([../examples/hanoi.m4], 0,
+AT_CHECK_M4([examples/hanoi.m4], 0,
 [[
 Move one disk from source to destination.
 Move one disk from source to auxilliary.
@@ -455,7 +455,7 @@
 OVERRIDE='This is an environment variable which we will change'
 export OVERRIDE
 
-AT_CHECK([$M4 -M ../../modules --import-environment -UZAPPED -DOVERRIDE='It is 
changed.' -d in], 0,
+AT_CHECK_M4([--import-environment -UZAPPED -DOVERRIDE='It is changed.' in], 0,
 [[TEST=This is an environment variable
 ZAPPED=ZAPPED
 OVERRIDE=It is changed.
@@ -488,7 +488,7 @@
 m4: ../examples/include.m4: 6: Cannot open NOFILE: No such file or directory
 ]])
 
-AT_CHECK_M4([../examples/include.m4], 0, expout, experr)
+AT_CHECK_M4([examples/include.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -513,7 +513,7 @@
 >>>%%$$##<<< cnt 0
 ]])
 
-AT_CHECK_M4([../examples/indir.m4], 0, expout)
+AT_CHECK_M4([examples/indir.m4], 0, expout)
 
 AT_CLEANUP
 
@@ -551,7 +551,7 @@
 This will be seen.
 ]])
 
-AT_CHECK([$M4 -M ../../modules -d iso8859.m4], 0, expout)
+AT_CHECK_M4([iso8859.m4], 0, expout)
 
 AT_CLEANUP
 
@@ -569,7 +569,7 @@
 
 EOF]
 
-AT_CHECK_M4([../examples/misc.m4], 0, expout)
+AT_CHECK_M4([examples/misc.m4], 0, expout)
 
 AT_CLEANUP
 
@@ -604,19 +604,19 @@
 
 # First generate the `expout' ouput by running over the sources before
 # freezeing.
-AT_CHECK([$M4 -M ../../modules -m load -d frozen.m4 unfrozen.m4], 0,
-         [stdout], [stderr])
+AT_CHECK_M4([-m load frozen.m4 unfrozen.m4], 0,
+            [stdout], [stderr])
 
 mv stdout expout
 mv stderr experr
 
 # Now freeze the first source file.
-AT_CHECK([$M4 -M ../../modules -m load -d -F frozen.m4f frozen.m4], 0,
-         [ignore], [ignore])
+AT_CHECK_M4([-m load -F frozen.m4f frozen.m4], 0,
+            [ignore], [ignore])
 
 # Now rerun the original sequence, but using the frozen file.
-AT_CHECK([$M4 -M ../../modules -d -R frozen.m4f unfrozen.m4], 0,
-         [expout], [experr])
+AT_CHECK_M4([-R frozen.m4f unfrozen.m4], 0,
+            [expout], [experr])
 
 AT_CLEANUP
 
@@ -629,7 +629,7 @@
 
 AT_SETUP([--module-directory: absolute path])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M `cd $top_builddir/modules; 
pwd` -m load -d ../modules/modtest.m4], 0,
+AT_CHECK([M4PATH=$top_srcdir $M4 -M `cd $top_builddir/modules; pwd` -m load -d 
modules/modtest.m4], 0,
 [[Test module loaded.
 Test module called.
 Dumpdef: .
@@ -648,7 +648,7 @@
 
 AT_SETUP([modpath2])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests LTDL_LIBRARY_PATH=../../modules $M4 
-m load -d ../modules/modtest.m4], 0,
+AT_CHECK([M4PATH=$top_srcdir LTDL_LIBRARY_PATH=$top_builddir/modules $M4 -m 
load -d modules/modtest.m4], 0,
 [[Test module loaded.
 Test module called.
 Dumpdef: .
@@ -672,7 +672,7 @@
 Dumpdef: dumpdef(`test').
 ]])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -m load -m modtest -M 
../../modules -d in], 0,
+AT_CHECK([$M4 -m load -m modtest -M $top_builddir/modules -d in], 0,
 [[Test module called.
 Dumpdef: .
 ]],
@@ -690,7 +690,7 @@
 
 AT_SETUP([M4MODPATH: absolute path])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests M4MODPATH=`cd $top_builddir/modules; 
pwd` $M4 -m load -d ../modules/modtest.m4], 0,
+AT_CHECK([M4PATH=$top_srcdir M4MODPATH=`cd $top_builddir/modules; pwd` $M4 -m 
load -d modules/modtest.m4], 0,
 [[Test module loaded.
 Test module called.
 Dumpdef: .
@@ -709,7 +709,7 @@
 
 AT_SETUP([modtest])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d 
../modules/modtest.m4], 0,
+AT_CHECK([M4PATH=$top_srcdir $M4 -M $top_builddir/modules -m load -d 
modules/modtest.m4], 0,
 [[Test module loaded.
 Test module called.
 Dumpdef: .
@@ -763,7 +763,7 @@
 m4trace: -1- dnl
 ]])
 
-AT_CHECK_M4([../examples/multiquotes.m4], 0, expout, experr)
+AT_CHECK_M4([examples/multiquotes.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -790,7 +790,7 @@
 [[m4: ../examples/patsubst.m4: 4: WARNING: \0 will disappear, use \& instead 
in replacements
 ]])
 
-AT_CHECK_M4([../examples/patsubst.m4], 0, expout, experr)
+AT_CHECK_M4([examples/patsubst.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -802,7 +802,7 @@
 
 AT_SETUP([pushdef/popdef])
 
-AT_CHECK_M4([../examples/pushpop.m4], 0, [],
+AT_CHECK_M4([examples/pushpop.m4], 0, [],
 [[hej: `def 1.'
 hej:   `def 2.'
 hej:   `def 3.'
@@ -854,7 +854,7 @@
 m4trace: -1- regexp(`hej med dig', `m\(.*\)') -> `4'
 ]])
 
-AT_CHECK_M4([../examples/regexp.m4], 0, expout, experr)
+AT_CHECK_M4([examples/regexp.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -866,7 +866,7 @@
 
 AT_SETUP([reverse])
 
-AT_CHECK_M4([../examples/reverse.m4], 0,
+AT_CHECK_M4([examples/reverse.m4], 0,
 [[
 `' => .
 `hej' => hej.
@@ -953,8 +953,8 @@
 shadow:        <shadow>
 ]])
 
-AT_CHECK([$M4 -M ../../modules -m load -d ../modules/shadow.m4], 0,
-         expout, experr)
+AT_CHECK_M4([-m load modules/shadow.m4], 0,
+            [expout], [experr])
 
 AT_CLEANUP
 
@@ -981,7 +981,7 @@
 foo foo
 ]])
 
-AT_CHECK([[$M4 -M ../../modules -d in]], 0,
+AT_CHECK_M4([[in]], 0,
 [[#line 2 "in"
 # Several input lines, expanding to one
 #line 5
@@ -1054,7 +1054,7 @@
 m4trace: -1- concat(`arguments') -> `ifelse(1, 1, `arguments', `arguments` 
'concat(shift(`arguments'))')'
 ]])
 
-AT_CHECK_M4([../examples/sysv-args.m4], 0, [expout], [experr])
+AT_CHECK_M4([examples/sysv-args.m4], 0, [expout], [experr])
 
 AT_CLEANUP
 
@@ -1151,7 +1151,7 @@
 
 ]])
 
-AT_CHECK_M4([../examples/trace.m4], 0, expout, experr)
+AT_CHECK_M4([examples/trace.m4], 0, expout, experr)
 
 AT_CLEANUP
 
@@ -1163,7 +1163,7 @@
 
 AT_SETUP([translit])
 
-AT_CHECK_M4([../examples/translit.m4], 0,
+AT_CHECK_M4([examples/translit.m4], 0,
 [[# traceon(`translit')dnl
 GNU  U
 GNUS NOT UNIX
@@ -1184,7 +1184,7 @@
 
 AT_SETUP([undivert])
 
-AT_CHECK_M4([../examples/undivert.m4], 0,
+AT_CHECK_M4([examples/undivert.m4], 0,
 [[
 # undiverted file.
 This is to be undiverted soon.
@@ -1251,7 +1251,7 @@
 __test__
 ]])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d in], 
0, expout)
+AT_CHECK_M4([-m load in], 0, expout)
 
 AT_CLEANUP
 
@@ -1263,7 +1263,7 @@
 
 AT_SETUP([wrap])
 
-AT_CHECK_M4([../examples/wrap.m4], 0,
+AT_CHECK_M4([examples/wrap.m4], 0,
 [[
 No. 33: The End.
 Wrapper no. 2
Index: tests/testsuite.at
===================================================================
RCS file: /cvs/m4/tests/testsuite.at,v
retrieving revision 1.1
diff -u -u -r1.1 testsuite.at
--- tests/testsuite.at 2001/08/17 11:58:27 1.1
+++ tests/testsuite.at 2001/08/17 14:11:52
@@ -21,15 +21,19 @@
 # AT_CHECK_M4(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
 # -----------------------------------------------------
 m4_define([AT_CHECK_M4],
-[AT_CHECK([M4PATH=$srcdir:$srcdir/../examples $M4 -M ../../modules -d $1],
+[AT_CHECK([M4PATH=$top_srcdir $M4 -M $top_builddir/modules -d $1],
           [m4_default([$2], [0])],
           [$3], [stderr])
 AT_CHECK([[sed 's,^[^:]*[lt-]*m4[.ex]*:,m4:,' stderr >&2]], 0, [], [$4])
 ])
 
-# Hand crafted tests.
+
+
 
 AT_INIT([$M4])
 
+# Hand crafted tests.
 m4_include([others.at])
+
+# From the documention.
 m4_include([generated.at])



reply via email to

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