summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-05-01 08:53:18 -0600
committerEric Blake <ebb9@byu.net>2008-05-01 08:53:18 -0600
commit6abccf89a8f468530209cf5b2f6178ab343af2a4 (patch)
treef9fd0ec330a2bcbd0dc5657459c26127d68b07f2
parentc3e7dc183995ae374f6aedec21893b23196a5b39 (diff)
downloadm4-6abccf89a8f468530209cf5b2f6178ab343af2a4.tar.gz
Improve debugmode testing, based on recent branch-1.6 regressions.
* doc/m4.texinfo (Debugmode): Enhance tests. * tests/generate.awk: Run tests from stdin, not input.m4. Support stderr munging when using -I examples. Signed-off-by: Eric Blake <ebb9@byu.net>
-rw-r--r--ChangeLog5
-rw-r--r--doc/m4.texinfo40
-rwxr-xr-xtests/generate.awk22
3 files changed, 56 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 79da06b8..684a3a4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-05-01 Eric Blake <ebb9@byu.net>
+ Improve debugmode testing, based on recent branch-1.6 regressions.
+ * doc/m4.texinfo (Debugmode): Enhance tests.
+ * tests/generate.awk: Run tests from stdin, not input.m4. Support
+ stderr munging when using -I examples.
+
Fix regression in define from 2008-02-22.
* m4/m4module.h (m4_symbol_value_copy): Add parameter.
* m4/symtab.c (m4_symbol_value_copy): Support copying $@
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 69ec5dc1..c593a8da 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -4040,7 +4040,15 @@ debugmode()
foo
@error{}m4trace: -1- foo -> `FOO'
@result{}FOO
+debugmode(`V')
+@result{}
+foo(`BAR')
+@error{}m4trace:stdin:6: -1- id 6: foo ... = `FOO$1'
+@error{}m4trace:stdin:6: -1- id 6: foo(`BAR') -> `FOOBAR'
+@result{}FOOBAR
debugmode
+@error{}m4trace:stdin:7: -1- id 7: debugmode ... = <debugmode>@{gnu@}
+@error{}m4trace:stdin:7: -1- id 7: debugmode ->@w{ }
@result{}
foo
@error{}m4trace: -1- foo
@@ -4048,15 +4056,39 @@ foo
debugmode(`+clmx')
@result{}
foo(divnum)
-@error{}m4trace:8: -1- id 8: foo ... = FOO$1
-@error{}m4trace:8: -2- id 9: divnum ... = <divnum>@{m4@}
-@error{}m4trace:8: -2- id 9: divnum
-@error{}m4trace:8: -1- id 8: foo
+@error{}m4trace:10: -1- id 10: foo ... = FOO$1
+@error{}m4trace:10: -2- id 11: divnum ... = <divnum>@{m4@}
+@error{}m4trace:10: -2- id 11: divnum
+@error{}m4trace:10: -1- id 10: foo
@result{}FOO0
debugmode(`-m')
@result{}
@end example
+This example shows the effects of the debug flags that are not related
+to macro tracing.
+
+@comment examples
+@comment options: -dip
+@example
+$ @kbd{m4 -dip -I examples}
+@error{}m4debug: input read from stdin
+define(`foo', `m4wrap(`wrapped text
+')dnl')
+@result{}
+include(`incl.m4')dnl
+@error{}m4debug: path search for `incl.m4' found `examples/incl.m4'
+@error{}m4debug: input read from examples/incl.m4
+@result{}Include file start
+@result{}Include file end
+@error{}m4debug: input reverted to stdin, line 3
+^D
+@error{}m4debug: input exhausted
+@error{}m4debug: input from m4wrap recursion level 1
+@result{}wrapped text
+@error{}m4debug: input from m4wrap exhausted
+@end example
+
@node Debuglen
@section Limiting debug output
diff --git a/tests/generate.awk b/tests/generate.awk
index 979995bf..692e21b6 100755
--- a/tests/generate.awk
+++ b/tests/generate.awk
@@ -1,6 +1,7 @@
# Extract all examples from the manual source. -*- AWK -*-
-# Copyright (C) 1992, 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1992, 2000, 2001, 2006, 2007, 2008 Free Software
+# Foundation, Inc.
#
# This file is part of GNU M4.
#
@@ -141,7 +142,6 @@ function normalize(contents, i, lines, n, line, res) {
gsub ("@tabchar{}", "\t", line);
gsub ("@w{ }", " @\\&t@", line);
gsub ("m4_", "m@\\&t@4_", line);
- gsub ("stdin", "input.m4", line);
# Some of the examples have improperly balanced square brackets.
gsub ("[[]", "@<:@", line);
@@ -181,23 +181,31 @@ function new_test(input, status, output, error, options, xfail, examples) {
printf ("AT_DATA([expout1],\n[[%s]])\n", output);
printf ("sed -e \"s|examples|$abs_top_srcdir/examples|g\" \\\n");
printf (" < expout1 > expout\n\n");
+ if (error)
+ {
+ printf ("AT_DATA([experr1],\n[[%s]])\n", error);
+ printf ("sed \"s|examples|$abs_top_srcdir/examples|g\" \\\n");
+ printf (" < experr1 > experr\n\n");
+ }
options = options " -I\"$abs_top_srcdir/examples\"";
}
printf ("AT_DATA([[input.m4]],\n[[%s]])\n\n", input);
# Some of these tests `include' files from tests/.
- printf ("AT_CHECK_M4([[%s input.m4]], %s,", options, status);
+ printf ("AT_CHECK_M4([[%s]], %s,", options, status);
if (examples == 1)
printf ("\n[expout]");
else if (output)
printf ("\n[[%s]]", output);
else
printf (" []");
- if (error)
- printf (",\n[[%s]])", error);
+ if (examples == 1 && error)
+ printf (",\n[experr]");
+ else if (error)
+ printf (",\n[[%s]]", error);
else
- printf (")");
- printf ("\n\n");
+ printf (", []");
+ printf (", [[input.m4]])\n\n");
}
function fatal(msg) {