autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.67-41-g


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.67-41-g79fc970
Date: Fri, 27 Aug 2010 18:05:20 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=79fc9707ae20b5a98b11419444923afca651179f

The branch, master has been updated
       via  79fc9707ae20b5a98b11419444923afca651179f (commit)
      from  e9cceec734dafd433b7038228fe4cf80f7adf5fb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 79fc9707ae20b5a98b11419444923afca651179f
Author: Ralf Wildenhues <address@hidden>
Date:   Mon Aug 2 22:42:55 2010 +0200

    Avoid long lines in testsuite script.
    
    * lib/autotest/general.m4 (AT_INIT): Remove definition of
    AT_groups_all.  Initialize at_groups from at_help_all, with
    newlines instead of spaces separating test groups numbers.
    Adjust all code to newlines.
    * NEWS: Update.
    * tests/autotest.at (Huge testsuite): New test.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |    8 +++++
 NEWS                    |    3 ++
 lib/autotest/general.m4 |   71 ++++++++++++++++++----------------------------
 tests/autotest.at       |   14 +++++++++
 4 files changed, 53 insertions(+), 43 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0230867..6accc2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-08-27  Ralf Wildenhues  <address@hidden>
 
+       Avoid long lines in testsuite script.
+       * lib/autotest/general.m4 (AT_INIT): Remove definition of
+       AT_groups_all.  Initialize at_groups from at_help_all, with
+       newlines instead of spaces separating test groups numbers.
+       Adjust all code to newlines.
+       * NEWS: Update.
+       * tests/autotest.at (Huge testsuite): New test.
+
        Try to update config.cache atomically; respect symlinks.
        * lib/autoconf/general.m4 (AC_CACHE_SAVE): Use `mv -f' to update
        the cache file if it is a regular file and not a symlink.  Move
diff --git a/NEWS b/NEWS
index 79ed028..bfe55e6 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ GNU Autoconf NEWS - User visible changes.
    runs do not leave behind broken cache files.  It is still unspecified
    which subset or union of results is cached though.
 
+** Autotest testsuites should not contain long text lines any more, and be
+   portable even when very many test groups are used.
+
 
 * Major changes in Autoconf 2.67 (2010-07-21) [stable]
   Released by Eric Blake, based on git versions 2.66.*.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index e639ce6..cdc82b9 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -202,7 +202,6 @@ m4_define([AT_INIT],
    [m4_expand([: $1])]))]
 [m4_define([AT_ordinal], 0)]
 [m4_define([AT_banner_ordinal], 0)]
-[m4_define([AT_groups_all], [])]
 [m4_define([AT_help_all], [])]
 [m4_map_args([_m4_popdef], _AT_DEFINE_INIT_LIST)]
 [m4_wrap([_AT_FINISH])]
@@ -226,11 +225,10 @@ at_cli_args="address@hidden"
 
 m4_divert_push([BANNERS])dnl
 
-# Should we print banners?  at_groups is space-separated for entire test,
-# newline-separated if only a subset of the testsuite is run.
-case $at_groups in
-  *' '*' '* | *"$as_nl"*"$as_nl"* )
-      at_print_banners=: ;;
+# Should we print banners?  Yes if more than one test is run.
+case $at_groups in #(
+  *$as_nl* )
+      at_print_banners=: ;; #(
   * ) at_print_banners=false ;;
 esac
 # Text for banner N, set to a single space once printed.
@@ -435,14 +433,14 @@ at_color=m4_ifdef([AT_color], [AT_color], [no])
 # List of the tested programs.
 at_tested='m4_ifdef([AT_tested],
   [m4_translit(m4_dquote(m4_defn([AT_tested])), [ ], m4_newline)])'
-# List of the all the test groups.
-at_groups_all='AT_groups_all'
 # 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]), [.], [?])'
 # Description of all the test groups.
 at_help_all="AS_ESCAPE(m4_dquote(m4_defn([AT_help_all])))"
+# List of the all the test groups.
+at_groups_all=`AS_ECHO(["$at_help_all"]) | sed 's/;.*//'`
 
 AS_FUNCTION_DESCRIBE([at_fn_validate_ranges], [NAME...],
 [Validate and normalize the test group number contained in each
@@ -535,24 +533,24 @@ do
 
     [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
        at_fn_validate_ranges at_option
-       AS_VAR_APPEND([at_groups], ["$at_option "])
+       AS_VAR_APPEND([at_groups], ["$at_option$as_nl"])
        ;;
 
     # Ranges
     [[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-])
        at_range_start=`echo $at_option |tr -d X-`
        at_fn_validate_ranges at_range_start
-       at_range=`AS_ECHO([" $at_groups_all "]) | \
-         sed -e 's/^.* \('$at_range_start' \)/\1/'`
-       AS_VAR_APPEND([at_groups], ["$at_range "])
+       at_range=`AS_ECHO(["$at_groups_all"]) | \
+         sed -ne '/^'$at_range_start'$/,$p'`
+       AS_VAR_APPEND([at_groups], ["$at_range$as_nl"])
        ;;
 
     [-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
        at_range_end=`echo $at_option |tr -d X-`
        at_fn_validate_ranges at_range_end
-       at_range=`AS_ECHO([" $at_groups_all "]) | \
-         sed -e 's/\( '$at_range_end'\) .*$/\1/'`
-       AS_VAR_APPEND([at_groups], ["$at_range "])
+       at_range=`AS_ECHO(["$at_groups_all"]) | \
+         sed -ne '1,/^'$at_range_end'$/p'`
+       AS_VAR_APPEND([at_groups], ["$at_range$as_nl"])
        ;;
 
     [[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9]] | \
@@ -569,10 +567,9 @@ do
          at_range_start=$at_tmp
        fi
        at_fn_validate_ranges at_range_start at_range_end
-       at_range=`AS_ECHO([" $at_groups_all "]) | \
-         sed -e 's/^.*\( '$at_range_start' \)/\1/' \
-             -e 's/\( '$at_range_end'\) .*$/\1/'`
-       AS_VAR_APPEND([at_groups], ["$at_range "])
+       at_range=`AS_ECHO(["$at_groups_all"]) | \
+         sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
+       AS_VAR_APPEND([at_groups], ["$at_range$as_nl"])
        ;;
 
     # Directory selection.
@@ -627,11 +624,9 @@ do
          at_groups_selected=`AS_ECHO(["$at_groups_selected"]) |
              grep -i $at_invert ["^[1-9][^;]*;.*[; ]$at_keyword[ ;]"]`
        done
-       # Smash the newlines.
-       at_groups_selected=`AS_ECHO(["$at_groups_selected"]) | sed 's/;.*//' |
-         tr "$as_nl" ' '
-       `
-       AS_VAR_APPEND([at_groups], ["$at_groups_selected "])
+       # Smash the keywords.
+       at_groups_selected=`AS_ECHO(["$at_groups_selected"]) | sed 's/;.*//'`
+       AS_VAR_APPEND([at_groups], ["$at_groups_selected$as_nl"])
        ;;
     --recheck)
        at_recheck=:
@@ -679,11 +674,11 @@ else
        s/^[ ]*\([1-9][0-9]*\):.*/\1/p
       }
       /^## Detailed failed tests/q
-      '] "$at_suite_log" | tr "$as_nl" ' '`
-    AS_VAR_APPEND([at_groups], ["$at_oldfails"])
+      '] "$at_suite_log"`
+    AS_VAR_APPEND([at_groups], ["$at_oldfails$as_nl"])
   fi
   # Sort the tests, removing duplicates.
-  at_groups=`AS_ECHO(["$at_groups"]) | tr ' ' "$as_nl" | sort -nu`
+  at_groups=`AS_ECHO(["$at_groups"]) | sort -nu | sed '/^$/d'`
 fi
 
 if test x"$at_color" = xalways \
@@ -777,21 +772,13 @@ AT_TESTSUITE_NAME test groups:
       KEYWORDS
 
 _ATEOF
-  # Passing at_groups is tricky.  We cannot use it to form a literal string
-  # or regexp because of the limitation of AIX awk.  And Solaris' awk
-  # doesn't grok more than 99 fields in a record, so we have to use `split'.
-  # at_groups needs to be space-separated for this script to work.
-  case $at_groups in
-    *"$as_nl"* )
-      at_groups=`AS_ECHO(["$at_groups"]) | tr "$as_nl" ' '` ;;
-  esac
-  AS_ECHO(["$at_groups$as_nl$at_help_all"]) |
-    awk 'BEGIN { FS = ";" }
-        NR == 1 {
-          for (n = split ($ 0, a, " "); n; n--)
-            selected[[a[n]]] = 1
+  # Pass an empty line as separator between selected groups and help.
+  AS_ECHO(["$at_groups$as_nl$as_nl$at_help_all"]) |
+    awk 'NF == 1 && FS != ";" {
+          selected[[$ 1]] = 1
           next
         }
+        /^$/ { FS = ";" }
         NF > 0 {
           if (selected[[$ 1]]) {
             printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
@@ -1392,8 +1379,7 @@ dnl cause changed test semantics; e.g., a sleep will be 
interrupted.
 
   echo
   # Turn jobs into a list of numbers, starting from 1.
-  at_joblist=`AS_ECHO([" $at_groups_all "]) | \
-    sed 's/\( '$at_jobs'\) .*/\1/'`
+  at_joblist=`AS_ECHO(["$at_groups"]) | sed -n 1,${at_jobs}p`
 
   set X $at_joblist
   shift
@@ -1844,7 +1830,6 @@ m4_define([AT_line], AT_LINE)
 m4_define([AT_xfail], [at_xfail=no])
 m4_define([AT_description], m4_expand([$1]))
 m4_define([AT_ordinal], m4_incr(AT_ordinal))
-m4_append([AT_groups_all], [ ]m4_defn([AT_ordinal]))
 m4_divert_push([TEST_GROUPS])dnl
 [#AT_START_]AT_ordinal
 at_fn_group_banner AT_ordinal 'm4_defn([AT_line])' \
diff --git a/tests/autotest.at b/tests/autotest.at
index 811417b..fc636e9 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -811,6 +811,20 @@ AT_CHECK([:])
 ])
 
 
+## ---------------- ##
+## Huge testsuite.  ##
+## ---------------- ##
+
+# Ensure we don't hit line length limits with large test suites.
+
+AT_CHECK_AT_TEST([Huge testsuite],
+[m4_for([nnn], [1], [1999], [],
+[AT_CLEANUP
+AT_SETUP([test ]nnn)
+])
+], [], [], [], [ignore], [], [], [1999])
+
+
 ## ----------------- ##
 ## Debugging a test. ##
 ## ----------------- ##


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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