autoconf-patches
[Top][All Lists]
Advanced

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

`testsuite' output alignment


From: Noah Misch
Subject: `testsuite' output alignment
Date: Sat, 18 Dec 2004 01:24:27 -0800
User-agent: Mutt/1.5.6i

The `ok' for m4sh and m4sugar tests do not align with the rest because those
test names contain quadrigraphs, of which m4_format knows nothing.  This patch
fixes that alignment by way of some new m4sugar primitives.

Other m4_format calls may deserve similar instrumentation.  This is the only
case I have noticed personally, so I started with it.

This[1] bug report suggested the nature of the fix to me, but I did not fix the
user-visible formatting bug reported there.  I'll look into it sometime.

The general.m4 change may look strange.  I could no longer add extra quotes to
the format string, so I moved them to the input string and adjusted the spacing
count to accommodate.

Tested with GNU userspace.

[1] http://lists.gnu.org/archive/html/bug-autoconf/2004-10/msg00000.html

2004-12-18  Noah Misch  <address@hidden>

        * lib/m4sugar/m4sugar.m4 (m4_qlen, m4_qdelta): New macros.
        * lib/autotest/general.m4 (AT_SETUP): Use m4_qdelta.

diff --exclude=Makefile.am -urp -X dontdiff ac-clean/lib/autotest/general.m4 
ac-help_quad/lib/autotest/general.m4
--- ac-clean/lib/autotest/general.m4    2004-12-14 22:30:02.000000000 -0500
+++ ac-help_quad/lib/autotest/general.m4        2004-12-15 22:52:36.000000000 
-0500
@@ -1048,8 +1048,8 @@ m4_divert_push([TESTS])dnl
   AT_ordinal ) @%:@ AT_ordinal. m4_defn([AT_line]): $1
     at_setup_line='m4_defn([AT_line])'
     at_desc='$1'
-    $at_quiet $ECHO_N "m4_format([[%3d: %-45s]],
-                      AT_ordinal, [$1])[]$ECHO_C"
+    $at_quiet $ECHO_N "m4_format([%3d: %-]m4_eval(47 - m4_qdelta([$1]))[s],
+                      AT_ordinal, [[$1]])[]$ECHO_C"
 m4_divert_push([TEST_SCRIPT])dnl
 ])
 
diff --exclude=Makefile.am -urp -X dontdiff ac-clean/lib/m4sugar/m4sugar.m4 
ac-help_quad/lib/m4sugar/m4sugar.m4
--- ac-clean/lib/m4sugar/m4sugar.m4     2004-08-20 15:58:08.000000000 -0400
+++ ac-help_quad/lib/m4sugar/m4sugar.m4 2004-12-15 22:52:01.000000000 -0500
@@ -3,7 +3,7 @@ divert(-1)#                             
 # Base M4 layer.
 # Requires GNU M4.
 #
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
 # Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -1615,6 +1615,21 @@ m4_define([m4_text_box],
 ])
 
 
+# m4_qlen(STRING)
+# ---------------
+# Expands to the length of STRING after autom4te converts all quadrigraphs.
+m4_define([m4_qlen],
+[m4_len(m4_bpatsubsts([[$1]], address@hidden(<:\|:>\|S|\|%:\)@], [P], 
[@&address@hidden))])
+
+
+# m4_qdelta(STRING)
+# -----------------
+# Expands to the net change in the length of STRING from autom4te converting 
the
+# quadrigraphs in STRING.  This number is always negative or zero.
+m4_define([m4_qdelta],
+[m4_eval(m4_qlen([$1]) - m4_len([$1]))])
+
+
 
 ## ----------------------- ##
 ## 10. Number processing.  ##




reply via email to

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