autoconf-patches
[Top][All Lists]
Advanced

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

FYI: 16-trace-format.patch


From: Akim Demaille
Subject: FYI: 16-trace-format.patch
Date: 31 Oct 2000 09:47:55 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

This should be added to tests/README.

* Write tests!
Don't let you be bitten three times by the same dog!  When you spent a
significant amount of time tracking the failure of feature in some
more primitive problem, immediately write a test for the latter.

If you track down several bugs down to the same origin, write a test
especially for it.

Of course in both cases, more primitive tests will be run beforehand.
Write your test and have it failed before your fixing, and succeeding
after.  This usually means having at hand two copies of the source
tree, one running the test suite to have it fail, and the other to
have the same testsuite succeed.


Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * tests/tools.at (Tracing M4 builtins): New test.

Index: autoconf.sh
--- autoconf.sh Tue, 31 Oct 2000 03:55:17 +0100 akim (ace/17_autoconf.s 
1.31.8.28 664)
+++ autoconf.sh Tue, 31 Oct 2000 04:48:12 +0100 akim (ace/17_autoconf.s 
1.31.8.28 664)
@@ -559,7 +559,14 @@
   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:
     #
Index: tests/tools.at
--- tests/tools.at Tue, 31 Oct 2000 02:29:48 +0100 akim (ace/b/30_tools.m4 1.18 
644)
+++ tests/tools.at Tue, 31 Oct 2000 04:50:20 +0100 akim (ace/b/30_tools.m4 1.18 
644)
@@ -74,12 +74,15 @@
 ## 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)
@@ -122,6 +125,31 @@ AC_DEFUN(TRACE2, [[$2], $1])
 [ACTIVE])===([baz]
 [active]
 [active])===([])===([ACTIVE]
+]])
+
+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



reply via email to

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