summaryrefslogtreecommitdiff
path: root/tests/trace.1.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/trace.1.test')
-rwxr-xr-xtests/trace.1.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/trace.1.test b/tests/trace.1.test
new file mode 100755
index 00000000..7d103f7f
--- /dev/null
+++ b/tests/trace.1.test
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# trace.1.test is part of the GNU m4 testsuite
+# generated from example in ../doc/m4.texinfo line 1706
+
+. ${srcdir}/defs
+
+cat <<\EOF >in
+define(`foo', `Hello World.')
+define(`echo', `$@')
+traceon(`foo', `echo')
+foo
+echo(gnus, and gnats)
+EOF
+
+cat <<\EOF >ok
+
+
+
+Hello World.
+gnus,and gnats
+EOF
+
+cat <<\EOF >okerr
+m4trace: -1- foo -> `Hello World.'
+m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
+EOF
+
+$M4 -d in >out 2>err
+sed -e "s, ../../src/m4:, m4:," err >sederr && mv sederr err
+
+$CMP -s out ok && $CMP -s err okerr
+