m4-patches
[Top][All Lists]
Advanced

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

07-autotest-others.patch


From: Akim Demaille
Subject: 07-autotest-others.patch
Date: Fri, 17 Aug 2001 13:47:45 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        Start using Autotest.  atconfig creation is still lacking.

        * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
        * examples/reverse.m4, tests/other-tests/import-environment.m4,
        * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
        * tests/other-tests/import-environment.test: Don't check LANGUAGE
        as it might be `unset', or set to `C'.
        * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
        * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
        * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
        * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
        * tests/other-tests/shadow.test: Adjust.
        * tests/testsuite.at, tests/others.at: New.
        * tests/Makefile.am: Adjust.

Index: modules/modtest.m4
--- modules/modtest.m4 Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ modules/modtest.m4 Thu, 16 Aug 2001 21:29:18 +0200 akim
@@ -1,3 +1,3 @@
-load(`modtest') 
+load(`modtest')
 test
-Dumpdef: dumpdef(`test')
+Dumpdef: dumpdef(`test').
Index: modules/shadow.m4
--- modules/shadow.m4 Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ modules/shadow.m4 Thu, 16 Aug 2001 21:26:22 +0200 akim
@@ -19,7 +19,7 @@
 define(`Shadow::test', defn(`test'))
 
 # module Test also defines a `test' macro
-load(`modtest') 
+load(`modtest')
 dumpdef(`test')
 dumpdef(`shadow')
 test
Index: examples/patsubst.m4
--- examples/patsubst.m4 Thu, 19 Nov 1998 14:02:11 +0100 demaille
+++ examples/patsubst.m4 Thu, 16 Aug 2001 22:15:39 +0200 akim
@@ -1,8 +1,8 @@
 # traceon(`patsubst')
-patsubst(`GNUs not Unix', `^', `OBS: ')
-patsubst(`GNUs not Unix', `\<', `OBS: ')
-patsubst(`GNUs not Unix', `\<\w', `\0=')
-patsubst(`GNUs not Unix', `\w*', `(\0)')
-patsubst(`GNUs not Unix', `\w+', `(\0)')
-patsubst(`GNUs not Unix', `\w+')
-patsubst(`GNUs  not     Unix', `[      ]+', ` ')
+patsubst(`GNUs not Unix.', `^', `OBS: ')
+patsubst(`GNUs not Unix.', `\<', `OBS: ')
+patsubst(`GNUs not Unix.', `\<\w', `\0=')
+patsubst(`GNUs not Unix.', `\w*', `(\0)')
+patsubst(`GNUs not Unix.', `\w+', `(\0)')
+patsubst(`GNUs not Unix.', `\w+')
+patsubst(`GNUs  not     Unix.', `[     ]+', ` ')
Index: examples/reverse.m4
--- examples/reverse.m4 Thu, 19 Nov 1998 14:02:11 +0100 demaille
+++ examples/reverse.m4 Thu, 16 Aug 2001 21:25:38 +0200 akim
@@ -1,4 +1,4 @@
 define(`reverse', `ifelse(eval($# > 1), 1, `reverse(shift($@)), `$1'', 
``$1'')')
-``'' => reverse
-``hej'' => reverse(hej)
-``hej, med, dig'' => reverse(hej, med, dig)
+``'' => reverse.
+``hej'' => reverse(hej).
+``hej, med, dig'' => reverse(hej, med, dig).
Index: tests/Makefile.am
--- tests/Makefile.am Thu, 16 Aug 2001 17:25:17 +0200 akim
+++ tests/Makefile.am Thu, 16 Aug 2001 21:18:08 +0200 akim
@@ -21,7 +21,7 @@
 # The previous line is needed by `./esyscmd.1.test'
 
 EXTRA_DIST = get-them run-test mkconfig.sh foo incl.m4 stamp-TESTS \
-       defs $(TESTS) $(OTHER_FILES)
+       defs $(TESTS) $(OTHER_FILES) $(TESTSUITE_SOURCES) testsuite
 
 MAINTAINERCLEANFILES = Makefile.in $(GENERATED_TESTS) config.m4 config.sh \
        stamp-TESTS
@@ -159,3 +159,18 @@ stamp-TESTS: $(srcdir)/get-them $(top_sr
 
 clean-local:
        rm -rf testSubDir
+
+TESTSUITE_SOURCES = testsuite.at others.at
+TESTSUITE = testsuite
+
+check-local: atconfig $(TESTSUITE)
+       $(SHELL) $(TESTSUITE)
+
+# FIXME: Autom4te is not complete yet, and lacks a means to find
+# the lib files.
+AUTOM4TE = autom4te
+AUTOTEST = $(AUTOM4TE) -I /usr/local/share/autoconf autotest/general.m4
+$(srcdir)/$(TESTSUITE): $(TESTSUITE_SOURCES)
+       $(AUTOTEST) -I $(srcdir) testsuite.at -o address@hidden
+       chmod +x address@hidden
+       mv address@hidden $@
Index: tests/other-tests/import-environment.m4
--- tests/other-tests/import-environment.m4 Thu, 18 Feb 1999 08:42:42 +0100 
demaille
+++ tests/other-tests/import-environment.m4 Thu, 16 Aug 2001 22:10:29 +0200 akim
@@ -1,4 +1,3 @@
 `TEST'=TEST
-`LANGUAGE'=LANGUAGE
 `ZAPPED'=ZAPPED
 `OVERRIDE'=OVERRIDE
Index: tests/other-tests/import-environment.test
--- tests/other-tests/import-environment.test Fri, 10 Aug 2001 14:01:13 +0200 
akim
+++ tests/other-tests/import-environment.test Thu, 16 Aug 2001 22:05:53 +0200 
akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -32,7 +32,6 @@
 
 cat <<\EOF >ok
 TEST=This is an environment variable
-LANGUAGE=C
 ZAPPED=ZAPPED
 OVERRIDE=It is changed.
 EOF
Index: tests/other-tests/iso8859.m4
--- tests/other-tests/iso8859.m4 Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/iso8859.m4 Thu, 16 Aug 2001 21:58:35 +0200 akim
@@ -1,13 +1,13 @@
 # Testing quotes
-DEFINE                 define(`test', `TEST')
-CHANGEQUOTE(«,»)       changequote(«,»)
+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(«««,»»»)
+CHANGEQUOTE(«««,»»»)   changequote(«««,»»»)# eol
 0 test                 # TEST
 1 «test»               # «TEST»
 2 ««test»»             # ««TEST»»
@@ -16,11 +16,11 @@
 dnl
 dnl
 # Test use of all iso8859 characters except ^Z (win32 EOF) and NUL  ` '
-define(`noquotes', `    
+define(`noquotes', `    \n
 
 !"#$%&()*+,-./0123456789:;<=>address@hidden|}~€‚ƒ„…
†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ 
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ')dnl
 dnl
 `Length of string is: 'len(defn(`noquotes'))
-`Comparing strings: 'ifelse(defn(`noquotes'), ` 
+`Comparing strings: 'ifelse(defn(`noquotes'), ` \n
 
 !"#$%&()*+,-./0123456789:;<=>address@hidden|}~€‚ƒ„…
†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ 
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ',
 `MATCH', `NO MATCH')
 dnl
 dnl
Index: tests/other-tests/iso8859.test
--- tests/other-tests/iso8859.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/iso8859.test Thu, 16 Aug 2001 22:37:39 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -23,19 +23,19 @@
 
 cat <<\EOF >ok
 # Testing quotes
-DEFINE                 
-CHANGEQUOTE(«,»)       
+DEFINE                 # eol
+CHANGEQUOTE(«,»)       # eol
 0 TEST                 # TEST
 1 test                 # test
 2 «test»               # «test»
 3 ««test»»             # ««test»»
-CHANGEQUOTE(«««,»»»)   
+CHANGEQUOTE(«««,»»»)   # eol
 0 TEST                 # TEST
 1 «TEST»               # «TEST»
 2 ««TEST»»             # ««TEST»»
 3 test                 # test
 # Test use of all iso8859 characters except ^Z (win32 EOF) and NUL  ` '
-Length of string is: 252
+Length of string is: 254
 Comparing strings: MATCH
 # NUL does not pass through
 This will be seen.
Index: tests/other-tests/modpath1.test
--- tests/other-tests/modpath1.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/modpath1.test Thu, 16 Aug 2001 22:34:18 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -24,9 +24,9 @@
 cat ${srcdir}/../modules/modtest.m4 >in
 
 cat <<'EOF' >ok
-Test module loaded. 
+Test module loaded.
 Test module called.
-Dumpdef: 
+Dumpdef: .
 EOF
 
 cat <<'EOF' >okerr
Index: tests/other-tests/modpath2.test
--- tests/other-tests/modpath2.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/modpath2.test Thu, 16 Aug 2001 22:34:29 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -24,9 +24,9 @@
 cat ${srcdir}/../modules/modtest.m4 >in
 
 cat <<'EOF' >ok
-Test module loaded. 
+Test module loaded.
 Test module called.
-Dumpdef: 
+Dumpdef: .
 EOF
 
 cat <<'EOF' >okerr
Index: tests/other-tests/modpath3.test
--- tests/other-tests/modpath3.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/modpath3.test Thu, 16 Aug 2001 22:34:45 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -23,12 +23,12 @@
 
 cat <<'EOF' >in
 test
-Dumpdef: dumpdef(`test')
+Dumpdef: dumpdef(`test').
 EOF
 
 cat <<'EOF' >ok
 Test module called.
-Dumpdef: 
+Dumpdef: .
 EOF
 
 cat <<'EOF' >okerr
Index: tests/other-tests/modpath4.test
--- tests/other-tests/modpath4.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/modpath4.test Thu, 16 Aug 2001 22:34:57 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -25,9 +25,9 @@
 
 
 cat <<'EOF' >ok
-Test module loaded. 
+Test module loaded.
 Test module called.
-Dumpdef: 
+Dumpdef: .
 EOF
 
 cat <<'EOF' >okerr
Index: tests/other-tests/modtest.test
--- tests/other-tests/modtest.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/modtest.test Thu, 16 Aug 2001 21:29:33 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -25,9 +25,9 @@
 
 
 cat <<'EOF' >ok
-Test module loaded. 
+Test module loaded.
 Test module called.
-Dumpdef: 
+Dumpdef: .
 EOF
 
 cat <<'EOF' >okerr
Index: tests/other-tests/patsubst.test
--- tests/other-tests/patsubst.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/patsubst.test Thu, 16 Aug 2001 22:15:55 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 1989-1994, 1999, 2000 Free Software Foundation, Inc.
-#  
+# Copyright 1989-1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -23,13 +23,13 @@
 
 cat <<\EOF >ok
 # traceon(`patsubst')
-OBS: GNUs not Unix
-OBS: GNUs OBS: not OBS: Unix
-G=NUs n=ot U=nix
-(GNUs)() (not)() (Unix)
-(GNUs) (not) (Unix)
-  
-GNUs not Unix
+OBS: GNUs not Unix.
+OBS: GNUs OBS: not OBS: Unix.
+G=NUs n=ot U=nix.
+(GNUs)() (not)() (Unix)().
+(GNUs) (not) (Unix).
+  .
+GNUs not Unix.
 EOF
 
 cat <<\EOF >okerr
Index: tests/other-tests/reverse.test
--- tests/other-tests/reverse.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/reverse.test Thu, 16 Aug 2001 21:25:52 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 1989-1994, 1999, 2000 Free Software Foundation, Inc.
-#  
+# Copyright 1989-1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -23,9 +23,9 @@
 
 cat <<\EOF >ok
 
-`' => 
-`hej' => hej
-`hej, med, dig' => dig, med, hej
+`' => .
+`hej' => hej.
+`hej, med, dig' => dig, med, hej.
 EOF
 
 M4PATH=$srcdir:$srcdir/../examples $M4 -M ../../modules -d in >out 2>err
Index: tests/other-tests/shadow.test
--- tests/other-tests/shadow.test Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ tests/other-tests/shadow.test Thu, 16 Aug 2001 22:35:16 +0200 akim
@@ -1,17 +1,17 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright 2000 Free Software Foundation, Inc.
-#  
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+#
 # 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
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@@ -45,7 +45,7 @@ Shadow::shadow called.
 
 
 # module Test also defines a `test' macro
-Test module loaded. 
+Test module loaded.
 
 
 Test module called.
Index: tests/testsuite.at
--- 0.13/tests/testsuite.at Fri, 17 Aug 2001 08:47:22 +0200 akim ()
+++ tests/testsuite.at Thu, 16 Aug 2001 22:28:38 +0200 akim
@@ -0,0 +1,34 @@
+# Process this file with autom4te to create testsuite. -*- Autoconf -*-
+
+# Test suite for GNU M4.
+# Copyright 2001 Free Software Foundation, Inc.
+
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# 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]],
+          [m4_default([$2], [0])],
+          [$3], [stderr])
+AT_CHECK([[sed 's,^[^:]*[lt-]*m4[.ex]*:,m4:,' stderr >&2]], 0, [], [$4])
+])
+
+# Hand crafted tests.
+
+AT_INIT([$M4])
+
+m4_include([others.at])
Index: tests/others.at
--- 0.13/tests/others.at Fri, 17 Aug 2001 08:47:22 +0200 akim ()
+++ tests/others.at Thu, 16 Aug 2001 22:23:56 +0200 akim
@@ -0,0 +1,1196 @@
+# Hand crafted tests for GNU M4.                               -*- Autoconf -*-
+# Copyright 2001 Free Software Foundation, Inc.
+
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# sed -e "s,^[^:]*[lt-]*m4[.ex]*:,m4:," err >sederr && mv sederr err
+
+
+
+## ---------- ##
+## capitalize ##
+## ---------- ##
+
+AT_SETUP([capitalize])
+
+AT_CHECK_M4([../examples/capitalize.m4], 0,
+[[
+
+CONVERT TO UPPER CASE
+convert to lower case
+
+
+This Sentence Should Be Capitalized
+]])
+
+AT_CLEANUP
+
+
+
+## ---------- ##
+## changeword ##
+## ---------- ##
+
+AT_SETUP([changeword])
+
+# cannot perform test without --enable-changeword
+AT_CHECK([test -z "$ENABLE_CHANGEWORD" && exit 77])
+
+AT_DATA([[in]],
+[[define(1, 0)
+1
+changeword(`[_a-zA-Z0-9]+')
+1
+]])
+
+AT_CHECK([$M4 -M ../../modules -m changeword -d in], 0,
+[[
+1
+
+0
+]])
+
+AT_CLEANUP
+
+
+
+
+## -------- ##
+## comments ##
+## -------- ##
+
+AT_SETUP([comments])
+
+AT_CHECK_M4([../examples/comments.m4], 0,
+[[# An ordinary comment
+
+# A comment in a macro
+Macro foo expansion
+
+
+# A *** Macro comment expansion *** in a macro
+Macro foo expansion
+]])
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## ddivert ##
+## ------- ##
+
+AT_SETUP([ddivert])
+
+AT_CHECK_M4([../examples/ddivert.m4], 0,
+[[Text diverted a first time.
+Text diverted a second time.
+]])
+
+AT_CLEANUP
+
+
+
+## ----- ##
+## debug ##
+## ----- ##
+
+AT_SETUP([debug])
+
+AT_DATA([[expout]],
+[[
+
+
+2 1 0 Liftoff
+]])
+
+AT_DATA([[experr]],
+[[m4trace: -1- countdown ...
+m4trace: -1- countdown(`2') -> ???
+m4trace: -1- countdown(...) -> `2 ifelse(eval(2 > 0), 1, `countdown(decr(2))', 
`Liftoff')'
+m4trace: -1- countdown ...
+m4trace: -1- countdown(`1') -> ???
+m4trace: -1- countdown(...) -> `1 ifelse(eval(1 > 0), 1, `countdown(decr(1))', 
`Liftoff')'
+m4trace: -1- countdown ...
+m4trace: -1- countdown(`0') -> ???
+m4trace: -1- countdown(...) -> `0 ifelse(eval(0 > 0), 1, `countdown(decr(0))', 
`Liftoff')'
+]])
+
+AT_CHECK_M4([../examples/debug.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## ---------------- ##
+## discard-comments ##
+## ---------------- ##
+
+AT_SETUP([discard-comments])
+
+AT_DATA([[expout]],
+[[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
+
+
+
+## ------- ##
+## esyscmd ##
+## ------- ##
+
+AT_SETUP([esyscmd])
+
+AT_CHECK_M4([../examples/esyscmd.m4], 0,
+[[# Cannot use real hostname program because test would fail
+hostname = >>www.gnu.org
+<<
+hostname = >>www<<
+]])
+
+AT_CLEANUP
+
+
+
+## --- ##
+## exp ##
+## --- ##
+
+AT_SETUP([exp])
+
+AT_CHECK_M4([../examples/exp.m4], 0,
+[[7
+6
+5
+4
+3
+2
+1
+0
+Done
+]])
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## foreach ##
+## ------- ##
+
+AT_SETUP([foreach])
+
+AT_CHECK_M4([../examples/foreach.m4], 0,
+[[
+Word was: foo
+Word was: bar
+Word was: foobar
+
+
+# Quote torture from Akim Demaille <address@hidden>
+Word was: a
+Word was: (b
+Word was: c)
+
+
+# Something more complex, from Pierre Gaumond <address@hidden>.
+case "$1" in
+  1)
+    vara=" -1";;
+  2)
+    varb=" -2";;
+  3)
+    varc=" -3";;
+esac
+]])
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## forloop ##
+## ------- ##
+
+AT_SETUP([forloop])
+
+AT_CHECK_M4([../examples/forloop.m4], 0,
+[[
+2**1 = 2
+2**2 = 4
+2**3 = 8
+2**4 = 16
+2**5 = 32
+2**6 = 64
+2**7 = 128
+2**8 = 256
+2**9 = 512
+2**10 = 1024
+
+]])
+
+AT_CLEANUP
+
+
+
+## ----- ##
+## fstab ##
+## ----- ##
+
+AT_SETUP([fstab])
+
+AT_CHECK_M4([../examples/fstab.m4], 0,
+[[
+
+
+freja:/home/gevn          /home/gevn       nfs    rw,soft,bg,grpid 0 0
+freja:/home/freja         /home/freja      nfs    rw,soft,grpid    0 0
+rimfaxe:/home/rimfaxe     /home/rimfaxe    nfs    rw,soft,bg       0 0
+
+]])
+
+AT_CLEANUP
+
+
+
+## --- ##
+## gmp ##
+## --- ##
+
+AT_SETUP([gmp])
+
+# cannot perform test without --with-gmp
+AT_CHECK([test -z "$WITH_GMP" && exit 77])
+
+AT_DATA([[expout]],
+[[
+2**1 = 2
+2**2 = 4
+2**3 = 8
+2**4 = 16
+2**5 = 32
+2**6 = 64
+2**7 = 128
+2**8 = 256
+2**9 = 512
+2**10 = 1024
+2**11 = 2048
+2**12 = 4096
+2**13 = 8192
+2**14 = 16384
+2**15 = 32768
+2**16 = 65536
+2**17 = 131072
+2**18 = 262144
+2**19 = 524288
+2**20 = 1048576
+2**21 = 2097152
+2**22 = 4194304
+2**23 = 8388608
+2**24 = 16777216
+2**25 = 33554432
+2**26 = 67108864
+2**27 = 134217728
+2**28 = 268435456
+2**29 = 536870912
+2**30 = 1073741824
+2**31 = 2147483648
+2**32 = 4294967296
+2**33 = 8589934592
+2**34 = 17179869184
+2**35 = 34359738368
+2**36 = 68719476736
+2**37 = 137438953472
+2**38 = 274877906944
+2**39 = 549755813888
+2**40 = 1099511627776
+2**41 = 2199023255552
+2**42 = 4398046511104
+2**43 = 8796093022208
+2**44 = 17592186044416
+2**45 = 35184372088832
+2**46 = 70368744177664
+2**47 = 140737488355328
+2**48 = 281474976710656
+2**49 = 562949953421312
+2**50 = 1125899906842624
+2**51 = 2251799813685248
+2**52 = 4503599627370496
+2**53 = 9007199254740992
+2**54 = 18014398509481984
+2**55 = 36028797018963968
+2**56 = 72057594037927936
+2**57 = 144115188075855872
+2**58 = 288230376151711744
+2**59 = 576460752303423488
+2**60 = 1152921504606846976
+2**61 = 2305843009213693952
+2**62 = 4611686018427387904
+2**63 = 9223372036854775808
+2**64 = 18446744073709551616
+2**65 = 36893488147419103232
+2**66 = 73786976294838206464
+2**67 = 147573952589676412928
+2**68 = 295147905179352825856
+2**69 = 590295810358705651712
+2**70 = 1180591620717411303424
+2**71 = 2361183241434822606848
+2**72 = 4722366482869645213696
+2**73 = 9444732965739290427392
+2**74 = 18889465931478580854784
+2**75 = 37778931862957161709568
+2**76 = 75557863725914323419136
+2**77 = 151115727451828646838272
+2**78 = 302231454903657293676544
+2**79 = 604462909807314587353088
+2**80 = 1208925819614629174706176
+2**81 = 2417851639229258349412352
+2**82 = 4835703278458516698824704
+2**83 = 9671406556917033397649408
+2**84 = 19342813113834066795298816
+2**85 = 38685626227668133590597632
+2**86 = 77371252455336267181195264
+2**87 = 154742504910672534362390528
+2**88 = 309485009821345068724781056
+2**89 = 618970019642690137449562112
+2**90 = 1237940039285380274899124224
+2**91 = 2475880078570760549798248448
+2**92 = 4951760157141521099596496896
+2**93 = 9903520314283042199192993792
+2**94 = 19807040628566084398385987584
+2**95 = 39614081257132168796771975168
+2**96 = 79228162514264337593543950336
+2**97 = 158456325028528675187087900672
+2**98 = 316912650057057350374175801344
+2**99 = 633825300114114700748351602688
+2**100 = 1267650600228229401496703205376
+
+]])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m mpeval -d 
other-tests/gmp.m4], 0,
+expout)
+
+AT_CLEANUP
+
+
+
+## ----- ##
+## hanoi ##
+## ----- ##
+
+AT_SETUP([hanoi])
+
+AT_CHECK_M4([../examples/hanoi.m4], 0,
+[[
+Move one disk from source to destination.
+Move one disk from source to auxilliary.
+Move one disk from destination to auxilliary.
+Move one disk from source to destination.
+Move one disk from auxilliary to source.
+Move one disk from auxilliary to destination.
+Move one disk from source to destination.
+
+]])
+
+AT_CLEANUP
+
+
+
+## ------------------ ##
+## import-environment ##
+## ------------------ ##
+
+AT_SETUP([import-environment])
+
+TEST='This is an environment variable'
+export TEST
+
+ZAPPED='This is an environment variable which we will delete'
+export ZAPPED
+
+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,
+[[TEST=This is an environment variable
+ZAPPED=ZAPPED
+OVERRIDE=It is changed.
+]])
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## include ##
+## ------- ##
+
+AT_SETUP([include])
+
+AT_DATA([[expout]],
+[[Beginning.
+
+Intermidiate
+include test file.
+
+
+After
+
+very late
+]])
+
+AT_DATA([[experr]],
+[[m4: ../examples/include.m4: 2: Cannot open NOFILE: No such file or directory
+m4: ../examples/include.m4: 6: Cannot open NOFILE: No such file or directory
+]])
+
+AT_CHECK_M4([../examples/include.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## ----- ##
+## indir ##
+## ----- ##
+
+AT_SETUP([indir])
+
+AT_DATA([[expout]],
+[[
+
+# indir(`%%$$##', nonsens, nonsens)
+>>>%%$$##<<< cnt 2
+
+# indir(`indir', `%%$$##', nonsens)
+>>>%%$$##<<< cnt 1
+
+# indir(`indir', `indir', `indir', `indir', `%%$$##')
+>>>%%$$##<<< cnt 0
+]])
+
+AT_CHECK_M4([../examples/indir.m4], 0, expout)
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## iso8859 ##
+## ------- ##
+
+AT_SETUP([iso8859])
+
+AT_DATA([[expout]],
+[[# Testing quotes
+DEFINE                 # eol
+CHANGEQUOTE(«,»)       # eol
+0 TEST                 # TEST
+1 test                 # test
+2 «test»               # «test»
+3 ««test»»             # ««test»»
+CHANGEQUOTE(«««,»»»)   # eol
+0 TEST                 # TEST
+1 «TEST»               # «TEST»
+2 ««TEST»»             # ««TEST»»
+3 test                 # test
+# Test use of all iso8859 characters except ^Z (win32 EOF) and NUL  ` '
+Length of string is: 254
+Comparing strings: MATCH
+# NUL does not pass through
+This will be seen.
+]])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -d 
other-tests/iso8859.m4], 0,
+expout)
+
+AT_CLEANUP
+
+
+
+## ---- ##
+## misc ##
+## ---- ##
+
+AT_SETUP([misc])
+
+[cat >expout <<EOF
+
+`sed -n '/^root:/{ s/^root:[^:]*://;s/:.*$//;p;q;}' /etc/passwd`
+
+EOF]
+
+AT_CHECK_M4([../examples/misc.m4], 0, expout)
+
+AT_CLEANUP
+
+
+
+## --------- ##
+## modfreeze ##
+## --------- ##
+
+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_CLEANUP
+
+
+
+## -------- ##
+## modpath1 ##
+## -------- ##
+
+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,
+[[Test module loaded.
+Test module called.
+Dumpdef: .
+]],
+[[test:        <test>
+]])
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## modpath2 ##
+## -------- ##
+
+AT_SETUP([modpath2])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests LTDL_LIBRARY_PATH=../../modules $M4 
-m load -d ../modules/modtest.m4], 0,
+[[Test module loaded.
+Test module called.
+Dumpdef: .
+]],
+[[test:        <test>
+]])
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## modpath3 ##
+## -------- ##
+
+AT_SETUP([modpath3])
+
+AT_DATA([[in]],
+[[test
+Dumpdef: dumpdef(`test').
+]])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -m load -m modtest -M 
../../modules -d in], 0,
+[[Test module called.
+Dumpdef: .
+]],
+[[test:        <test>
+]])
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## modpath4 ##
+## -------- ##
+
+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,
+[[Test module loaded.
+Test module called.
+Dumpdef: .
+]],
+[[test:        <test>
+]])
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## modtest ##
+## ------- ##
+
+AT_SETUP([modtest])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d 
../modules/modtest.m4], 0,
+[[Test module loaded.
+Test module called.
+Dumpdef: .
+]],
+[[test:        <test>
+]])
+
+AT_CLEANUP
+
+
+
+## ----------- ##
+## multiquotes ##
+## ----------- ##
+
+AT_SETUP([multiquotes])
+
+AT_DATA([[expout]],
+[[
+``traceon''
+foo
+``FOO''
+
+BAR
+foo bar
+``FOO'' BAR
+*>*>*<*<
+]])
+
+AT_DATA([[experr]],
+[[m4trace: -1- changequote(`[', `]')
+m4trace: -1- dnl
+m4trace: -1- changequote([``], [''])
+m4trace: -1- dnl
+m4trace: -1- define(``foo'', ````FOO'''')
+m4trace: -1- dnl
+foo:   ````FOO''''
+m4trace: -1- dumpdef(``foo'')
+m4trace: -1- dnl
+m4trace: -1- changequote(``!'', ``!'')
+m4trace: -1- dnl
+foo:   !``FOO''!
+m4trace: -1- dumpdef(!foo!)
+m4trace: -1- dnl
+m4trace: -1- define(!bar!, !BAR!)
+m4trace: -1- changequote(!>*>*>*>*>!, !<*<*<*<*<!)
+m4trace: -1- dnl
+bar:   >*>*>*>*>BAR<*<*<*<*<
+foo:   >*>*>*>*>``FOO''<*<*<*<*<
+m4trace: -1- dumpdef(>*>*>*>*>foo<*<*<*<*<, >*>*>*>*>bar<*<*<*<*<)
+m4trace: -1- dnl
+]])
+
+AT_CHECK_M4([../examples/multiquotes.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## patsubst ##
+## -------- ##
+
+AT_SETUP([patsubst])
+
+AT_DATA([[expout]],
+[[# traceon(`patsubst')
+OBS: GNUs not Unix.
+OBS: GNUs OBS: not OBS: Unix.
+G=NUs n=ot U=nix.
+(GNUs)() (not)() (Unix)().
+(GNUs) (not) (Unix).
+  .
+GNUs not Unix.
+]])
+
+AT_DATA([[experr]],
+[[m4: ../examples/patsubst.m4: 4: WARNING: \0 will disappear, use \& instead 
in replacements
+]])
+
+AT_CHECK_M4([../examples/patsubst.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## ---------------- ##
+## pushdef/popdef.  ##
+## ---------------- ##
+
+AT_SETUP([pushdef/popdef])
+
+AT_CHECK_M4([../examples/pushpop.m4], 0, [],
+[[hej: `def 1.'
+hej:   `def 2.'
+hej:   `def 3.'
+hej:   `def 4.'
+hej:   `def 3.'
+hej:   `def 2.'
+hej:   `def 1.'
+m4: ../examples/pushpop.m4: 18: Undefined name hej
+m4: ../examples/pushpop.m4: 20: Undefined name hej
+m4: ../examples/pushpop.m4: 23: Undefined name mac2
+m4: ../examples/pushpop.m4: 25: Undefined name mac2
+]])
+
+AT_CLEANUP
+
+
+
+## ------ ##
+## regexp ##
+## ------ ##
+
+AT_SETUP([regexp])
+
+AT_DATA([[expout]],
+[[>>hej med dig<<
+>>hej<<
+>>hej med dig<<
+>>med<<
+>>med dig<< >>ed dig<<
+
+0
+0
+0
+4
+4
+]])
+
+AT_DATA([[experr]],
+[[m4: ../examples/regexp.m4: 2: WARNING: \0 will disappear, use \& instead in 
replacements
+m4trace: -1- regexp(`hej med dig', `.*', `>>\0<<') -> `>>hej med dig<<'
+m4trace: -1- regexp(`hej med dig', `\w*', `>>\0<<') -> `>>hej<<'
+m4trace: -1- regexp(`hej med dig', `.+', `>>\0<<') -> `>>hej med dig<<'
+m4trace: -1- regexp(`hej med dig', `m\w+', `>>\0<<') -> `>>med<<'
+m4trace: -1- regexp(`hej med dig', `m\(.*\)', `>>\0<< >>\1<<') -> `>>med dig<< 
>>ed dig<<'
+m4trace: -1- regexp(`hej med dig', `.*') -> `0'
+m4trace: -1- regexp(`hej med dig', `\w*') -> `0'
+m4trace: -1- regexp(`hej med dig', `.+') -> `0'
+m4trace: -1- regexp(`hej med dig', `m\w+') -> `4'
+m4trace: -1- regexp(`hej med dig', `m\(.*\)') -> `4'
+]])
+
+AT_CHECK_M4([../examples/regexp.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## ------- ##
+## reverse ##
+## ------- ##
+
+AT_SETUP([reverse])
+
+AT_CHECK_M4([../examples/reverse.m4], 0,
+[[
+`' => .
+`hej' => hej.
+`hej, med, dig' => dig, med, hej.
+]])
+
+AT_CLEANUP
+
+
+
+## ------ ##
+## shadow ##
+## ------ ##
+
+AT_SETUP([shadow])
+
+AT_DATA([[expout]],
+[[# no modules loaded yet
+test
+shadow
+
+# define our own macros for `test' and `shadow'
+
+
+local::test
+local::shadow
+
+# module Shadow defines `shadow' and `test' macros
+Shadow module loaded.
+
+
+Shadow::test called.
+Shadow::shadow called.
+
+# save the definition of `test' from the Shadow module
+
+
+# module Test also defines a `test' macro
+Test module loaded.
+
+
+Test module called.
+Shadow::shadow called.
+
+# Reloading Shadow shouldn't affect anything
+
+
+
+Test module called.
+Shadow::shadow called.
+
+# Unloading Test will unshadow the test definition in Shadow
+
+
+
+Shadow::test called.
+Shadow::shadow called.
+
+# Unloading Shadow once has no effect (we loaded it twice)
+
+
+
+Shadow::test called.
+Shadow::shadow called.
+
+# Unloading Shadow again will revert to copying `test' and the local
+# `shadow' macro.
+
+local::test
+local::shadow
+]])
+
+AT_DATA([[experr]],
+[[test:        <test>
+shadow:        <shadow>
+test:  <test>
+shadow:        <shadow>
+test:  <test>
+shadow:        <shadow>
+test:  <test>
+shadow:        <shadow>
+test:  <test>
+shadow:        <shadow>
+]])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d 
../modules/shadow.m4], 0,
+expout, experr)
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## stackovf ##
+## -------- ##
+
+AT_SETUP([stackovf])
+
+AT_CHECK([[M4PATH=$srcdir:$srcdir/other-tests $M4 -M ../../modules -d 
other-tests/sync-lines.m4]], 0,
+[[#line 2 "other-tests/sync-lines.m4"
+# Several input lines, expanding to one
+#line 5
+ xyz
+foo line one.
+#line 6
+foo line two.
+#line 6
+foo line three.
+# Several input lines, expanding to none
+#line 11
+# one input line, expanding to several output lines
+foo line one.
+#line 12
+foo line two.
+#line 12
+foo line three. foo line one.
+#line 12
+foo line two.
+#line 12
+foo line three.
+]])
+
+AT_CLEANUP
+
+
+
+## --------- ##
+## sysv-args ##
+## --------- ##
+
+AT_SETUP([sysv-args])
+
+AT_DATA([[expout]],
+[[
+
+0
+1
+6
+
+
+hej med dig
+hej med dig en gang igen
+an awful lot of argument at least more that ten silly arguments
+]])
+
+AT_DATA([[experr]],
+[[m4trace: -1- nargs -> `0'
+m4trace: -1- nargs(`') -> `1'
+m4trace: -1- nargs(`1', `2', `3', `4', `5', `6') -> `6'
+m4trace: -1- concat(`') -> `ifelse(1, 1, `', `` 'concat(shift(`'))')'
+m4trace: -1- concat(`hej', `med', `dig') -> `ifelse(1, 3, `hej', `hej` 
'concat(shift(`hej',`med',`dig'))')'
+m4trace: -1- concat(`med', `dig') -> `ifelse(1, 2, `med', `med` 
'concat(shift(`med',`dig'))')'
+m4trace: -1- concat(`dig') -> `ifelse(1, 1, `dig', `dig` 
'concat(shift(`dig'))')'
+m4trace: -1- concat(`hej', `med', `dig', `en gang igen') -> `ifelse(1, 4, 
`hej', `hej` 'concat(shift(`hej',`med',`dig',`en gang igen'))')'
+m4trace: -1- concat(`med', `dig', `en gang igen') -> `ifelse(1, 3, `med', 
`med` 'concat(shift(`med',`dig',`en gang igen'))')'
+m4trace: -1- concat(`dig', `en gang igen') -> `ifelse(1, 2, `dig', `dig` 
'concat(shift(`dig',`en gang igen'))')'
+m4trace: -1- concat(`en gang igen') -> `ifelse(1, 1, `en gang igen', `en gang 
igen` 'concat(shift(`en gang igen'))')'
+m4trace: -1- concat(`an', `awful', `lot', `of', `argument', `at', `least', 
`more', `that', `ten', `silly', `arguments') -> `ifelse(1, 12, `an', `an` 
'concat(shift(`an',`awful',`lot',`of',`argument',`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`awful', `lot', `of', `argument', `at', `least', `more', 
`that', `ten', `silly', `arguments') -> `ifelse(1, 11, `awful', `awful` 
'concat(shift(`awful',`lot',`of',`argument',`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`lot', `of', `argument', `at', `least', `more', `that', 
`ten', `silly', `arguments') -> `ifelse(1, 10, `lot', `lot` 
'concat(shift(`lot',`of',`argument',`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`of', `argument', `at', `least', `more', `that', `ten', 
`silly', `arguments') -> `ifelse(1, 9, `of', `of` 
'concat(shift(`of',`argument',`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`argument', `at', `least', `more', `that', `ten', `silly', 
`arguments') -> `ifelse(1, 8, `argument', `argument` 
'concat(shift(`argument',`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`at', `least', `more', `that', `ten', `silly', 
`arguments') -> `ifelse(1, 7, `at', `at` 
'concat(shift(`at',`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`least', `more', `that', `ten', `silly', `arguments') -> 
`ifelse(1, 6, `least', `least` 
'concat(shift(`least',`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`more', `that', `ten', `silly', `arguments') -> `ifelse(1, 
5, `more', `more` 'concat(shift(`more',`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`that', `ten', `silly', `arguments') -> `ifelse(1, 4, 
`that', `that` 'concat(shift(`that',`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`ten', `silly', `arguments') -> `ifelse(1, 3, `ten', `ten` 
'concat(shift(`ten',`silly',`arguments'))')'
+m4trace: -1- concat(`silly', `arguments') -> `ifelse(1, 2, `silly', `silly` 
'concat(shift(`silly',`arguments'))')'
+m4trace: -1- concat(`arguments') -> `ifelse(1, 1, `arguments', `arguments` 
'concat(shift(`arguments'))')'
+]])
+
+AT_CHECK_M4([../examples/sysv-args.m4], 0, [expout], [experr])
+
+AT_CLEANUP
+
+
+
+## ----- ##
+## trace ##
+## ----- ##
+
+AT_SETUP([trace])
+
+AT_DATA([[expout]],
+[[
+# Debugmode t
+
+Move one disk from source to auxilliary.
+Move one disk from source to destination.
+Move one disk from auxilliary to destination.
+
+
+# Debugmode taeq
+
+Move one disk from source to auxilliary.
+Move one disk from source to destination.
+Move one disk from auxilliary to destination.
+
+
+# Debugmode OFF
+
+Move one disk from source to auxilliary.
+Move one disk from source to destination.
+Move one disk from auxilliary to destination.
+
+
+# Debugmode ae
+
+
+Move one disk from source to auxilliary.
+Move one disk from source to destination.
+Move one disk from auxilliary to destination.
+
+]])
+
+AT_DATA([[experr]],
+[[m4trace: -1- hanoi
+m4trace: -1- _hanoi
+m4trace: -2- eval
+m4trace: -1- ifelse
+m4trace: -2- decr
+m4trace: -1- _hanoi
+m4trace: -2- eval
+m4trace: -1- ifelse
+m4trace: -1- move
+m4trace: -1- move
+m4trace: -2- decr
+m4trace: -1- _hanoi
+m4trace: -2- eval
+m4trace: -1- ifelse
+m4trace: -1- move
+
+m4trace: -1- hanoi(`2') -> `_hanoi(`2', source, destination, auxilliary)'
+m4trace: -1- _hanoi(`2', `source', `destination', `auxilliary') -> 
`ifelse(eval(`2'<=1), 1, `move(source, destination)',
+`_hanoi(decr(2), source, auxilliary, destination)move(source, 
destination)_hanoi(decr(2), auxilliary, destination, source)')'
+m4trace: -2- eval(`2<=1') -> `0'
+m4trace: -1- ifelse(`0', `1', `move(source, destination)', `_hanoi(decr(2), 
source, auxilliary, destination)move(source, destination)_hanoi(decr(2), 
auxilliary, destination, source)') -> `_hanoi(decr(2), source, auxilliary, 
destination)move(source, destination)_hanoi(decr(2), auxilliary, destination, 
source)'
+m4trace: -2- decr(`2') -> `1'
+m4trace: -1- _hanoi(`1', `source', `auxilliary', `destination') -> 
`ifelse(eval(`1'<=1), 1, `move(source, auxilliary)',
+`_hanoi(decr(1), source, destination, auxilliary)move(source, 
auxilliary)_hanoi(decr(1), destination, auxilliary, source)')'
+m4trace: -2- eval(`1<=1') -> `1'
+m4trace: -1- ifelse(`1', `1', `move(source, auxilliary)', `_hanoi(decr(1), 
source, destination, auxilliary)move(source, auxilliary)_hanoi(decr(1), 
destination, auxilliary, source)') -> `move(source, auxilliary)'
+m4trace: -1- move(`source', `auxilliary') -> `Move one disk from `source' to 
`auxilliary'.
+'
+m4trace: -1- move(`source', `destination') -> `Move one disk from `source' to 
`destination'.
+'
+m4trace: -2- decr(`2') -> `1'
+m4trace: -1- _hanoi(`1', `auxilliary', `destination', `source') -> 
`ifelse(eval(`1'<=1), 1, `move(auxilliary, destination)',
+`_hanoi(decr(1), auxilliary, source, destination)move(auxilliary, 
destination)_hanoi(decr(1), source, destination, auxilliary)')'
+m4trace: -2- eval(`1<=1') -> `1'
+m4trace: -1- ifelse(`1', `1', `move(auxilliary, destination)', 
`_hanoi(decr(1), auxilliary, source, destination)move(auxilliary, 
destination)_hanoi(decr(1), source, destination, auxilliary)') -> 
`move(auxilliary, destination)'
+m4trace: -1- move(`auxilliary', `destination') -> `Move one disk from 
`auxilliary' to `destination'.
+'
+m4trace: -1- debugmode
+m4trace: -1- _hanoi(2, source, destination, auxilliary) -> 
ifelse(eval(`2'<=1), 1, `move(source, destination)',
+`_hanoi(decr(2), source, auxilliary, destination)move(source, 
destination)_hanoi(decr(2), auxilliary, destination, source)')
+m4trace: -1- _hanoi(1, source, auxilliary, destination) -> 
ifelse(eval(`1'<=1), 1, `move(source, auxilliary)',
+`_hanoi(decr(1), source, destination, auxilliary)move(source, 
auxilliary)_hanoi(decr(1), destination, auxilliary, source)')
+m4trace: -1- move(source, auxilliary) -> Move one disk from `source' to 
`auxilliary'.
+
+m4trace: -1- move(source, destination) -> Move one disk from `source' to 
`destination'.
+
+m4trace: -1- _hanoi(1, auxilliary, destination, source) -> 
ifelse(eval(`1'<=1), 1, `move(auxilliary, destination)',
+`_hanoi(decr(1), auxilliary, source, destination)move(auxilliary, 
destination)_hanoi(decr(1), source, destination, auxilliary)')
+m4trace: -1- move(auxilliary, destination) -> Move one disk from `auxilliary' 
to `destination'.
+
+]])
+
+AT_CHECK_M4([../examples/trace.m4], 0, expout, experr)
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## translit ##
+## -------- ##
+
+AT_SETUP([translit])
+
+AT_CHECK_M4([../examples/translit.m4], 0,
+[[# traceon(`translit')dnl
+GNU  U
+GNUS NOT UNIX
+gnus not unix
+s not nix
+z
+-ZY
+tmfs not fnix
+]])
+
+AT_CLEANUP
+
+
+
+## -------- ##
+## undivert ##
+## -------- ##
+
+AT_SETUP([undivert])
+
+AT_CHECK_M4([../examples/undivert.m4], 0,
+[[
+# undiverted file.
+This is to be undiverted soon.
+
+# included file.
+This is to be UNDIVERTED soon.
+
+]])
+
+AT_CLEANUP
+
+
+
+## ------ ##
+## unload ##
+## ------ ##
+
+AT_SETUP([unload])
+
+AT_DATA([[in]],
+[[test
+__test__
+load(`modtest')
+test
+__test__
+load(`shadow')
+test
+__test__
+unload(`modtest')
+test
+__test__
+load(`modtest')
+test
+__test__
+unload(`modtest')
+test
+__test__
+unload(`shadow')
+test
+__test__
+]])
+
+AT_DATA([[expout]],
+[[test
+__test__
+Test module loaded.
+Test module called.
+modtest
+Shadow module loaded.
+Shadow::test called.
+shadow
+
+Shadow::test called.
+shadow
+Test module loaded.
+Test module called.
+modtest
+
+Shadow::test called.
+shadow
+
+test
+__test__
+]])
+
+AT_CHECK([M4PATH=$srcdir:$srcdir/../tests $M4 -M ../../modules -m load -d in], 
0, expout)
+
+AT_CLEANUP
+
+
+
+## ---- ##
+## wrap ##
+## ---- ##
+
+AT_SETUP([wrap])
+
+AT_CHECK_M4([../examples/wrap.m4], 0,
+[[
+No. 33: The End.
+Wrapper no. 2
+Wrapper no. 1
+Wrapper no. 3
+Wrapper no. 4
+]])
+
+AT_CLEANUP



reply via email to

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