autoconf-patches
[Top][All Lists]
Advanced

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

Re: AT_KEYWORDS failure: cmdline OR-combinations


From: Ralf Wildenhues
Subject: Re: AT_KEYWORDS failure: cmdline OR-combinations
Date: Tue, 16 Aug 2005 19:36:07 +0200
User-agent: Mutt/1.4.1i

* Stepan Kasal wrote on Tue, Aug 16, 2005 at 07:15:13PM CEST:
> On Tue, Aug 16, 2005 at 06:10:52PM +0200, Ralf Wildenhues wrote:
> > I happen not to understand the exact nature of the bug report
> > that led to the breakage of this code in the first place:
> > http://lists.gnu.org/archive/html/autoconf-patches/2005-06/msg00041.html
> 
> I don't understand it either, but in this case you could change
> 
> > +   at_range_start=`expr $at_option : '\([[^-]]*\)'`
> > +   at_range_end=`expr $at_option : '[[^-]]*-\(.*\)'`
> 
> to
>       at_range_start=`expr $at_option : '\(.*\)-'`
>       at_range_end=`expr $at_option : '.*-\(.*\)'`
> 
> and hope that Mac OS X 10.4 will handle it.

Ahh.  Merci.

OK.  Here then goes again a complete patch.  Sorry for that confusion.

I've not redirected stderr: we want to see all failures.  I tested the
awk script (not the whole testsuite script) with all {,m,n,g}awk I could
find on recent GNU/Linux, Solaris, AIX.

Cheers,
Ralf

        * lib/autotest/general.m4 (AT_INIT): Add a couple of missing
        m4 quotes.  Process multiple keywords options correctly.
        Sort and uniquify the tests that will be run.
        Process ranges correctly so that N-N will run only N.
        Process N-M as M-N if M is smaller than N.
        * tests/autotest.at (Keywords): Unmark XFAIL.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.189
diff -u -r1.189 general.m4
--- lib/autotest/general.m4     27 Jul 2005 14:20:32 -0000      1.189
+++ lib/autotest/general.m4     16 Aug 2005 17:31:39 -0000
@@ -249,7 +249,6 @@
 at_help_all='AT_help_all'])])dnl
 m4_divert_push([PARSE_ARGS])dnl
 
-at_keywords=
 at_prev=
 for at_option
 do
@@ -323,11 +322,15 @@
     [[0-9][0-9][0-9]-[0-9][0-9][0-9]] | \
     [[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] | \
     [[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] )
-       at_range_start=`expr $at_option : '\([^-]*\)'`
-       at_range_end=`expr $at_option : '[^-]*-\(.*\)'`
-       # FIXME: Maybe test to make sure start <= end?
+        at_range_start=`expr $at_option : '\(.*\)-'`
+        at_range_end=`expr $at_option : '.*-\(.*\)'`
+       if test $at_range_start -gt $at_range_end; then
+         at_tmp=$at_range_end
+         at_range_end=$at_range_start
+         at_range_start=$at_tmp
+       fi
        at_range=`echo " $at_groups_all " | \
-         sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \
+         sed -e 's,^.* '$at_range_start' , '$at_range_start' ,' \
              -e 's, '$at_range_end' .*$, '$at_range_end','`
        at_groups="$at_groups$at_range "
        ;;
@@ -337,7 +340,17 @@
        at_prev=--keywords
        ;;
     --keywords=* )
-       at_keywords="$at_keywords,$at_optarg"
+       at_groups_selected=$at_help_all
+       for at_keyword in `IFS=,; set X $at_optarg; shift; echo address@hidden
+       do
+               # It is on purpose that we match the test group titles too.
+               at_groups_selected=`echo "$at_groups_selected" |
+               grep -i "^[[^;]]*;[[^;]]*.*[[; ]]$at_keyword[[ ;]]"`
+       done
+       at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
+       # Smash the end of lines.
+       at_groups_selected=`echo $at_groups_selected`
+       at_groups="$at_groups$at_groups_selected "
        ;;
 m4_divert_pop([PARSE_ARGS])dnl
 dnl Process *=* last to allow for user specified --option=* type arguments.
@@ -362,23 +375,30 @@
   esac
 done
 
-# Process the --keywords
-if test -n "$at_keywords"; then
-  at_groups_selected=$at_help_all
-  for at_keyword in `IFS=,; set X $at_keywords; shift; echo address@hidden
-  do
-    # It is on purpose that we match the test group titles too.
-    at_groups_selected=`echo "$at_groups_selected" |
-                       grep -i "^[[^;]]*;[[^;]]*.*[[; ]]$at_keyword[[ ;]]"`
-  done
-  at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
-  # Smash the end of lines.
-  at_groups_selected=`echo $at_groups_selected`
-  at_groups="$at_groups$at_groups_selected "
-fi
-
 # Selected test groups.
-test -z "$at_groups" && at_groups=$at_groups_all
+if test -z "$at_groups"; then
+  at_groups=$at_groups_all
+else
+  # Sort the tests, removing duplicates:
+  at_groups=`echo $at_groups | tr ' ' "$as_nl" | sort -nu`
+  # and add banners.
+  at_groups=`echo "$at_groups$as_nl$at_groups_all" |
+    awk ['BEGIN { FS = ";" }
+       !/ / { selected[$ 1]  = 1 }
+       / / {
+               n = split($ 0, a, " ")
+               for (i = 1; i <= n; i++) {
+                       if (a[i] ~ /^banner-/)
+                               banner = a[i]
+                       else if (banner != "" && selected[a[i]] == 1)
+                               selected[banner] = 1
+               }
+               for (i = 1; i <= n; i++)
+                       if (selected[a[i]] == 1)
+                               list = list " " a[i]
+               print list
+       }']`
+fi
 m4_divert_pop([PARSE_ARGS_END])dnl
 m4_divert_push([HELP])dnl
 
Index: tests/autotest.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.7
diff -u -r1.7 autotest.at
--- tests/autotest.at   15 Aug 2005 23:47:58 -0000      1.7
+++ tests/autotest.at   16 Aug 2005 17:31:39 -0000
@@ -248,7 +248,6 @@
 ## --------- ##
 AT_SETUP([Keywords])
 AT_KEYWORDS([autotest])
-AT_XFAIL_IF(:)
 
 AT_DATA([k.at],
 [[m4_define([AT_PACKAGE_STRING],[k])




reply via email to

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