index 79da06b88e0a6a08b0ae85528b6418b03980e26b..684a3a4f5292ab8088ed40eddb5a1287e68807ad 100644 (file)
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 $@
index 69ec5dc1bdaf475b92c8f92002e28a1ce98aa0cc..c593a8daf3bc1baf7fd0d028d9fac549db6b6142 100644 (file)
foo
@error{}m4trace: -1- foo -> `FOO'
@result{}FOO
+debugmode(`V')
+@result{}
+foo(`BAR')
+@error{}m4trace:stdin:6: -1- id 6: foo ... = `FOO1ドル'
+@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
debugmode(`+clmx')
@result{}
foo(divnum)
-@error{}m4trace:8: -1- id 8: foo ... = FOO1ドル
-@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 ... = FOO1ドル
+@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
index 979995bf36fea764afa672f8eed6c574ed40168d..692e21b672ec647f6c64883757b4b363e3dc5772 100755 (executable)
# 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) {