* autoconh.sh (trace_format): Fix its computation.
+2000-11-02 Akim Demaille <akim@epita.fr>
+
+ * tests/tools.at (Tracing M4 builtins): New test.
+ * autoconh.sh (trace_format): Fix its computation.
+
2000-11-02 Akim Demaille <akim@epita.fr>
* tests/atgeneral.m4 (AT_CHECK): Check stderr first, since if both
* autoconf.sh (task trace) [debug]: Instead of a long pipe, extend
trace.m4.
-
+
2000-11-02 Akim Demaille <akim@epita.fr>
* autoupdate.sh (m4.txt): Use `dumpdef' and m4 to build it.
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
+ # If for instance TRACE is `define', be sure to have an empty
+ # TRACE_FORMAT.
+ case $trace in
+ $macro_name:* )
+ trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;;
+ * )
+ trace_format=;;
+ esac
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
+ # If for instance TRACE is `define', be sure to have an empty
+ # TRACE_FORMAT.
+ case $trace in
+ $macro_name:* )
+ trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;;
+ * )
+ trace_format=;;
+ esac
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
+ # If for instance TRACE is `define', be sure to have an empty
+ # TRACE_FORMAT.
+ case $trace in
+ $macro_name:* )
+ trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;;
+ * )
+ trace_format=;;
+ esac
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
## autoconf --trace. ##
## ------------------ ##
+
+# Tracing user defined macros
+# ---------------------------
AT_SETUP(autoconf --trace)
AT_DATA(configure.in,
-[[define(active, ACTIVE)
-AC_DEFUN(TRACE1, [TRACE2(m4_shift($@))])
-AC_DEFUN(TRACE2, [[$2], $1])
+[[define([active], [ACTIVE])
+AC_DEFUN([TRACE1], [TRACE2(m4_shift($@))])
+AC_DEFUN([TRACE2], [[$2], $1])
TRACE1(foo, bar, baz)
TRACE1(foo, AC_TRACE1(bar, baz))
TRACE1(foo, active, baz)
AT_CLEANUP
+# Tracing builtins
+# ----------------
+AT_SETUP(Tracing M4 builtins)
+
+AT_DATA(configure.in,
+[[define([active], [ACTIVE])
+]])
+
+AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t define |
+ sed -n '$p']],
+ 0,
+[[configure.in:1:define:active:ACTIVE
+]])
+
+# FIXME: Without `$1' the following test dies. Groumphf, once again to
+# dive into obscure feature interaction...
+AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t define:'$1' -i |
+ sed -n '$p']],
+ 0,
+[[active
+]])
+
+AT_CLEANUP
+
+
## ----------------------------------------------- ##