m4-patches
[Top][All Lists]
Advanced

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

09-autotest-independence.patch


From: Akim Demaille
Subject: 09-autotest-independence.patch
Date: Fri, 17 Aug 2001 13:47:56 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        others.at no longer depends on other-tests/.

        * tests/others.at (stackovf): You're actually...
        (sync-lines): this.
        (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
        (unload.test): Keep their authorship.
        (discard-comments, gmp, import-environment, modfreeze)
        (sync-lines): Embed the input files.
        * tests/stackovf.test: Copy from other-tests/stackovf.test.
        * tests/iso8850.m4: Copy from other-tests/iso8859.m4.

Index: tests/Makefile.am
--- tests/Makefile.am Fri, 17 Aug 2001 11:08:20 +0200 akim
+++ tests/Makefile.am Fri, 17 Aug 2001 12:06:22 +0200 akim
@@ -142,6 +142,8 @@
        other-tests/wrap.test
 
 OTHER_FILES = \
+       iso8859.m4 \
+       stackovf.test \
        other-tests/frozen.m4 \
        other-tests/gmp.m4 \
        other-tests/iso8859.m4 \
Index: tests/others.at
--- tests/others.at Fri, 17 Aug 2001 08:47:41 +0200 akim
+++ tests/others.at Fri, 17 Aug 2001 12:10:55 +0200 akim
@@ -141,13 +141,21 @@ m4trace: -1- countdown(...) -> `0 ifelse
 
 AT_SETUP([discard-comments])
 
-AT_DATA([[expout]],
+AT_DATA([[in]],
+[[This is not a comment # but this is.
+# This line should dissappear completely.
+This should not disappear.
+changecom(`<!--', `-->')
+html <!--
+comment
+ --> ends.
+]])
+
+AT_CHECK([$M4 -c -M ../../modules -d in], 0,
 [[This is not a comment This should not disappear.
 
 html  ends.
 ]])
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -c -M ../../modules -d 
other-tests/discard-comments.m4], 0,
-[expout])
 
 AT_CLEANUP
 
@@ -280,6 +288,19 @@ rimfaxe:/home/rimfaxe     /home/rimfaxe 
 # cannot perform test without --with-gmp
 AT_CHECK([test -z "$WITH_GMP" && exit 77])
 
+AT_DATA([[in]],
+[[divert(-1)
+# forloop(i, from, to, stmt)
+
+define(`forloop', `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', 
`$4')popdef(`$1')')
+define(`_forloop',
+       `$4`'ifelse($1, `$3', ,
+                        `define(`$1', incr($1))_forloop(`$1', `$2', `$3', 
`$4')')')
+divert
+forloop(`x', 1, 100, `2**x = mpeval(2**x)
+')
+]])
+
 AT_DATA([[expout]],
 [[
 2**1 = 2
@@ -385,8 +406,7 @@ rimfaxe:/home/rimfaxe     /home/rimfaxe 
 
 ]])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m mpeval -d 
other-tests/gmp.m4], 0,
-expout)
+AT_CHECK([$M4 -M ../../modules -m mpeval -d in], 0, expout)
 
 AT_CLEANUP
 
@@ -420,6 +440,12 @@ rimfaxe:/home/rimfaxe     /home/rimfaxe 
 
 AT_SETUP([import-environment])
 
+AT_DATA([[in]],
+[[`TEST'=TEST
+`ZAPPED'=ZAPPED
+`OVERRIDE'=OVERRIDE
+]])
+
 TEST='This is an environment variable'
 export TEST
 
@@ -429,8 +455,7 @@ rimfaxe:/home/rimfaxe     /home/rimfaxe 
 OVERRIDE='This is an environment variable which we will change'
 export OVERRIDE
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests \
-$M4 -M ../../modules --import-environment -UZAPPED -DOVERRIDE='It is changed.' 
-d other-tests/import-environment.m4], 0,
+AT_CHECK([$M4 -M ../../modules --import-environment -UZAPPED -DOVERRIDE='It is 
changed.' -d in], 0,
 [[TEST=This is an environment variable
 ZAPPED=ZAPPED
 OVERRIDE=It is changed.
@@ -500,6 +525,12 @@ m4: ../examples/include.m4: 6: Cannot op
 
 AT_SETUP([iso8859])
 
+# Eh eh eh...
+# We can't embed iso8859.m4 in here since precisly this file demonstrates
+# an M4 ``bug'': it's inability to handle the NUL character.  So there
+# is no use in trying to handle it here...  Well, until autom4te provides
+# us with means to.
+
 AT_DATA([[expout]],
 [[# Testing quotes
 DEFINE                 # eol
@@ -520,8 +551,7 @@ m4: ../examples/include.m4: 6: Cannot op
 This will be seen.
 ]])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -d 
other-tests/iso8859.m4], 0,
-expout)
+AT_CHECK([$M4 -M ../../modules -d iso8859.m4], 0, expout)
 
 AT_CLEANUP
 
@@ -548,18 +578,45 @@ m4: ../examples/include.m4: 6: Cannot op
 ## --------- ##
 ## modfreeze ##
 ## --------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([modfreeze])
 
-# First generate the `expout' ouput by running over the sources before 
freezeing
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -m load -d 
frozen.m4 unfrozen.m4 >expout 2>experr])
-
-# Now freeze the first source file
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -m load -d 
-F frozen.m4f frozen.m4], 0,
-ignore, ignore)
-
-# Now rerun the original sequence, but using the frozen file
-AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -d -R 
frozen.m4f unfrozen.m4], 0, expout, experr)
+AT_DATA([[frozen.m4]],
+[[divert(1)dnl
+define(`test', `local::`test'')dnl
+define(`test1', defn(`test'))dnl
+->test
+load(`modtest')
+define(`test2', defn(`test'))dnl
+->test
+load(`shadow')
+define(`test3', defn(`test'))dnl
+->test
+]])
+
+AT_DATA([[unfrozen.m4]],
+[[undivert(1)dnl
+test1
+test2
+test3
+]])
+
+# 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])
+
+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])
+
+# 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_CLEANUP
 
@@ -568,6 +625,7 @@ m4: ../examples/include.m4: 6: Cannot op
 ## -------- ##
 ## modpath1 ##
 ## -------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([--module-directory: absolute path])
 
@@ -586,6 +644,7 @@ Dumpdef: .
 ## -------- ##
 ## modpath2 ##
 ## -------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([modpath2])
 
@@ -604,6 +663,7 @@ Dumpdef: .
 ## -------- ##
 ## modpath3 ##
 ## -------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([modpath3])
 
@@ -626,6 +686,7 @@ Dumpdef: .
 ## -------- ##
 ## modpath4 ##
 ## -------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([M4MODPATH: absolute path])
 
@@ -644,6 +705,7 @@ Dumpdef: .
 ## ------- ##
 ## modtest ##
 ## ------- ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([modtest])
 
@@ -818,6 +880,7 @@ m4trace: -1- regexp(`hej med dig', `m\(.
 ## ------ ##
 ## shadow ##
 ## ------ ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([shadow])
 
@@ -890,21 +953,36 @@ test:     <test>
 shadow:        <shadow>
 ]])
 
-AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d 
../modules/shadow.m4], 0,
-expout, experr)
+AT_CHECK([$M4 -M ../../modules -m load -d ../modules/shadow.m4], 0,
+         expout, experr)
 
 AT_CLEANUP
 
 
 
-## -------- ##
-## stackovf ##
-## -------- ##
+## ------------ ##
+## sync-lines.  ##
+## ------------ ##
+
+AT_SETUP([sync-lines])
 
-AT_SETUP([stackovf])
+AT_DATA([[in]],
+[[syncoutput(on)dnl
+# Several input lines, expanding to one
+define(`foo', ``foo' line one.
+`foo' line two.
+`foo' line three.') xyz
+foo
+# Several input lines, expanding to none
+define(`foo', ``foo' line one.
+`foo' line two.
+`foo' line three.')dnl
+# one input line, expanding to several output lines
+foo foo
+]])
 
-AT_CHECK([[M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -d 
other-tests/sync-lines.m4]], 0,
-[[#line 2 "other-tests/sync-lines.m4"
+AT_CHECK([[$M4 -M ../../modules -d in]], 0,
+[[#line 2 "in"
 # Several input lines, expanding to one
 #line 5
  xyz
@@ -1123,6 +1201,7 @@ m4trace: -1- move(auxilliary, destinatio
 ## ------ ##
 ## unload ##
 ## ------ ##
+# Written by Gary V. Vaughan <address@hidden>
 
 AT_SETUP([unload])
 
Index: tests/iso8859.m4
--- 0.15/tests/iso8859.m4 Fri, 17 Aug 2001 12:13:46 +0200 akim ()
+++ tests/iso8859.m4 Fri, 17 Aug 2001 11:54:11 +0200 akim
@@ -0,0 +1,29 @@
+# Testing quotes
+DEFINE                 define(`test', `TEST')# eol
+CHANGEQUOTE(«,»)       changequote(«,»)# eol
+0 test                 # TEST
+1 «test»                       # test
+2 ««test»»             # «test»
+3 «««test»»»           # ««test»»
+dnl
+changequote()dnl
+CHANGEQUOTE(«««,»»»)   changequote(«««,»»»)# eol
+0 test                 # TEST
+1 «test»               # «TEST»
+2 ««test»»             # ««TEST»»
+3 «««test»»»                   # test
+changequote`'dnl
+dnl
+dnl
+# Test use of all iso8859 characters except ^Z (win32 EOF) and NUL  ` '
+define(`noquotes', `    \n
+
 !"#$%&()*+,-./0123456789:;<=>address@hidden|}~€‚ƒ„…
†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ 
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ')dnl
+dnl
+`Length of string is: 'len(defn(`noquotes'))
+`Comparing strings: 'ifelse(defn(`noquotes'), ` \n
+
 !"#$%&()*+,-./0123456789:;<=>address@hidden|}~€‚ƒ„…
†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ 
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ',
 `MATCH', `NO MATCH')
+dnl
+dnl
+# NUL does not pass through
+define(`NUL_bug', `This will be seen.



reply via email to

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