]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autotest/general.m4 (_AT_NORMALIZE_TEST_GROUP_NUMBER): New macro.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Mar 2006 08:29:49 +0000 (08:29 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Mar 2006 08:29:49 +0000 (08:29 +0000)
(AT_INIT): Use it, to remove arbitrary limit of 999,999 test
cases, and to work around Tru64 expr bug.
* doc/autoconf.texi (Limitations of Usual Tools): Mention Tru64
expr bug that turns the result of a regex match into a number if
possible.

ChangeLog
doc/autoconf.texi
lib/autotest/general.m4

index ec9e594ec37a56c73b21daa2844e6e3e00be4143..73c0dbeda4423af243ffbf850c9269eaf9219a56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-03-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autotest/general.m4 (_AT_NORMALIZE_TEST_GROUP_NUMBER): New macro.
+       (AT_INIT): Use it, to remove arbitrary limit of 999,999 test
+       cases, and to work around Tru64 expr bug.
+
+2006-03-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * doc/autoconf.texi (Limitations of Usual Tools): Mention Tru64
+       expr bug that turns the result of a regex match into a number if
+       possible.
+
 2006-03-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * lib/autoconf/types.m4 (AC_CHECK_ALIGNOF): Work around
index 3c44da1c2d73bbff78ad1ef30790285a5c81dce2..473efb32ef24905e9e874a7cf8b52c7779b8cce9 100644 (file)
@@ -12203,6 +12203,14 @@ will output @samp{a} on most hosts, but @samp{aa} on @acronym{QNX} 4.25.  A
 simple workaround consists in testing @command{expr} and use a variable
 set to @command{expr} or to @command{false} according to the result.
 
+Tru64 @command{expr} incorrectly treats the result as a number, if it
+can be interpreted that way:
+
+@example
+$ @kbd{expr 00001 : '.*\(...\)'}
+1
+@end example
+
 
 @item @command{fgrep}
 @c ------------------
index 407dd11016276f05cd0c0b7e67b7a26ef894b064..338cefd4ead972e834a2200bc3901ebe9f274a8f 100644 (file)
@@ -148,6 +148,21 @@ m4_define([AT_LINE],
 [m4_bpatsubst(__file__, [^\(.*/\)*\(.*\)], [[\2]]):__line__])
 
 
+# _AT_NORMALIZE_TEST_GROUP_NUMBER(SHELL-VAR)
+# ------------------------------------------
+# Normalize SHELL-VAR so that its value has the same number of digits as
+# all the other test group numbers.
+m4_define([_AT_NORMALIZE_TEST_GROUP_NUMBER],
+[
+  while :; do
+    case $$1 in #(
+    $at_format*) break;;
+    esac
+    $1=0$$1
+  done
+])
+
+
 # AT_INIT([TESTSUITE-NAME])
 # -------------------------
 # Begin test suite.
@@ -241,10 +256,10 @@ m4_wrap([m4_divert_text([DEFAULTS],
 at_tested='m4_ifdef([AT_tested], [AT_tested])'
 # List of the all the test groups.
 at_groups_all='AT_groups_all'
-# As many dots as there are digits in the last test group number.
+# As many question marks as there are digits in the last test group number.
 # Used to normalize the test group numbers so that `ls' lists them in
 # numerical order.
-at_format='m4_bpatsubst(m4_defn([AT_ordinal]), [.], [.])'
+at_format='m4_bpatsubst(m4_defn([AT_ordinal]), [.], [?])'
 # Description of all the test groups.
 at_help_all='AT_help_all'])])dnl
 m4_divert_push([PARSE_ARGS])dnl
@@ -665,8 +680,8 @@ do
        *" $at_group "* ) continue;;
       esac
 
-      # Normalize the test group number.
-      at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`
+      at_group_normalized=$at_group
+      _AT_NORMALIZE_TEST_GROUP_NUMBER(at_group_normalized)
 
       # Create a fresh directory for the next test group, and enter.
       at_group_dir=$at_suite_dir/$at_group_normalized
@@ -934,8 +949,8 @@ else
       echo
       for at_group in $at_fail_list
       do
-        # Normalize the test group number and cat the log.
-        at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`
+        at_group_normalized=$at_group
+        _AT_NORMALIZE_TEST_GROUP_NUMBER(at_group_normalized)
         cat "$at_suite_dir/$at_group_normalized/$as_me.log"
         echo
       done