Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC/TESTSUITE]  completion.exp
@ 2003-04-08 23:24 Elena Zannoni
  2003-04-09 17:23 ` David Carlton
  0 siblings, 1 reply; 6+ messages in thread
From: Elena Zannoni @ 2003-04-08 23:24 UTC (permalink / raw)
  To: gdb-patches


Another one (I am going through the some RedHat Linux gdb patches, in
case it wasn't obvious).  This one is fairly specific, I am not sure
if it would be Ok for inclusion in the general sources, but just in case.

Again this is for the '+' character in the directory name.

elena

        * gdb.base/completion.exp: When matching on the current directory,
        make sure that any '+' in the directory name gets escaped.


Index: completion.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.14
diff -u -p -r1.14 completion.exp
--- completion.exp	4 Jan 2003 22:37:49 -0000	1.14
+++ completion.exp	8 Apr 2003 23:18:00 -0000
@@ -669,7 +669,12 @@ cd ${srcdir}
 set fullsrcdir [pwd]
 cd ${mydir}
 
-gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
+# If the directory name contains a '+' we must escape it, adding a backslash.
+# If not, the test below will fail because it will interpret the '+' as a 
+# regext operator.
+regsub -all \\+  ${fullsrcdir} \\\+ dirstring
+
+gdb_test "cd ${fullsrcdir}" "Working directory ${dirstring}.*" "cd to \${srcdir}"
 send_gdb "file ./gdb.base/compl\t"
 sleep 1
 gdb_expect  {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TESTSUITE]  completion.exp
  2003-04-08 23:24 [RFC/TESTSUITE] completion.exp Elena Zannoni
@ 2003-04-09 17:23 ` David Carlton
  2003-04-09 20:14   ` Elena Zannoni
  0 siblings, 1 reply; 6+ messages in thread
From: David Carlton @ 2003-04-09 17:23 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni <ezannoni@redhat.com> said:

> +# If the directory name contains a '+' we must escape it, adding a backslash.
> +# If not, the test below will fail because it will interpret the '+' as a 
> +# regext operator.
> +regsub -all \\+  ${fullsrcdir} \\\+ dirstring

Would it be better to use string_to_regexp instead of regsub?  (But
leaving in the comment as an indication of why you're using it.)

David Carlton
carlton@math.stanford.edu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TESTSUITE]  completion.exp
  2003-04-09 17:23 ` David Carlton
@ 2003-04-09 20:14   ` Elena Zannoni
  2003-04-09 20:35     ` David Carlton
  2003-04-09 20:57     ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: Elena Zannoni @ 2003-04-09 20:14 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches

David Carlton writes:
 > On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni <ezannoni@redhat.com> said:
 > 
 > > +# If the directory name contains a '+' we must escape it, adding a backslash.
 > > +# If not, the test below will fail because it will interpret the '+' as a 
 > > +# regext operator.
 > > +regsub -all \\+  ${fullsrcdir} \\\+ dirstring
 > 
 > Would it be better to use string_to_regexp instead of regsub?  (But
 > leaving in the comment as an indication of why you're using it.)
 > 

Ah, I didn't know about string_to_regexp. Yes, definitely, thank you.
How's this?

elena



Index: completion.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.14
diff -u -p -r1.14 completion.exp
--- completion.exp	4 Jan 2003 22:37:49 -0000	1.14
+++ completion.exp	9 Apr 2003 20:11:44 -0000
@@ -669,7 +669,14 @@ cd ${srcdir}
 set fullsrcdir [pwd]
 cd ${mydir}
 
-gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
+# If the directory name contains a '+' we must escape it, adding a backslash.
+# If not, the test below will fail because it will interpret the '+' as a 
+# regexp operator. We use string_to_regexp for this purpose.
+
+gdb_test "cd ${fullsrcdir}" \
+         "Working directory [string_to_regexp ${fullsrcdir}].*" \
+         "cd to \${srcdir}"
+
 send_gdb "file ./gdb.base/compl\t"
 sleep 1
 gdb_expect  {



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TESTSUITE]  completion.exp
  2003-04-09 20:14   ` Elena Zannoni
@ 2003-04-09 20:35     ` David Carlton
  2003-04-09 20:57     ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: David Carlton @ 2003-04-09 20:35 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

On Wed, 9 Apr 2003 16:18:26 -0400, Elena Zannoni <ezannoni@redhat.com> said:

> Ah, I didn't know about string_to_regexp.

Yeah, I just discovered it recently myself.  Useful.

> Yes, definitely, thank you.  How's this?

Works for me.  I'm actually amazed that there were so few places in
the testsuite that were affected by this issue.

David Carlton
carlton@math.stanford.edu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TESTSUITE]  completion.exp
  2003-04-09 20:14   ` Elena Zannoni
  2003-04-09 20:35     ` David Carlton
@ 2003-04-09 20:57     ` Daniel Jacobowitz
  2003-04-10 13:38       ` Elena Zannoni
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-04-09 20:57 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: David Carlton, gdb-patches

On Wed, Apr 09, 2003 at 04:18:26PM -0400, Elena Zannoni wrote:
> David Carlton writes:
>  > On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni <ezannoni@redhat.com> said:
>  > 
>  > > +# If the directory name contains a '+' we must escape it, adding a backslash.
>  > > +# If not, the test below will fail because it will interpret the '+' as a 
>  > > +# regext operator.
>  > > +regsub -all \\+  ${fullsrcdir} \\\+ dirstring
>  > 
>  > Would it be better to use string_to_regexp instead of regsub?  (But
>  > leaving in the comment as an indication of why you're using it.)
>  > 
> 
> Ah, I didn't know about string_to_regexp. Yes, definitely, thank you.
> How's this?

Looks right to me too.  I believe that in the current status quo you can
approve your own patches to the testsuite.

> elena
> 
> 
> 
> Index: completion.exp
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v
> retrieving revision 1.14
> diff -u -p -r1.14 completion.exp
> --- completion.exp	4 Jan 2003 22:37:49 -0000	1.14
> +++ completion.exp	9 Apr 2003 20:11:44 -0000
> @@ -669,7 +669,14 @@ cd ${srcdir}
>  set fullsrcdir [pwd]
>  cd ${mydir}
>  
> -gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
> +# If the directory name contains a '+' we must escape it, adding a backslash.
> +# If not, the test below will fail because it will interpret the '+' as a 
> +# regexp operator. We use string_to_regexp for this purpose.
> +
> +gdb_test "cd ${fullsrcdir}" \
> +         "Working directory [string_to_regexp ${fullsrcdir}].*" \
> +         "cd to \${srcdir}"
> +
>  send_gdb "file ./gdb.base/compl\t"
>  sleep 1
>  gdb_expect  {
> 
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TESTSUITE]  completion.exp
  2003-04-09 20:57     ` Daniel Jacobowitz
@ 2003-04-10 13:38       ` Elena Zannoni
  0 siblings, 0 replies; 6+ messages in thread
From: Elena Zannoni @ 2003-04-10 13:38 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Elena Zannoni, David Carlton, gdb-patches

Daniel Jacobowitz writes:
 > On Wed, Apr 09, 2003 at 04:18:26PM -0400, Elena Zannoni wrote:
 > > David Carlton writes:
 > >  > On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni <ezannoni@redhat.com> said:
 > >  > 
 > >  > > +# If the directory name contains a '+' we must escape it, adding a backslash.
 > >  > > +# If not, the test below will fail because it will interpret the '+' as a 
 > >  > > +# regext operator.
 > >  > > +regsub -all \\+  ${fullsrcdir} \\\+ dirstring
 > >  > 
 > >  > Would it be better to use string_to_regexp instead of regsub?  (But
 > >  > leaving in the comment as an indication of why you're using it.)
 > >  > 
 > > 
 > > Ah, I didn't know about string_to_regexp. Yes, definitely, thank you.
 > > How's this?
 > 
 > Looks right to me too.  I believe that in the current status quo you can
 > approve your own patches to the testsuite.
 > 

committed.

 > > Index: completion.exp
 > > ===================================================================
 > > RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v
 > > retrieving revision 1.14
 > > diff -u -p -r1.14 completion.exp
 > > --- completion.exp	4 Jan 2003 22:37:49 -0000	1.14
 > > +++ completion.exp	9 Apr 2003 20:11:44 -0000
 > > @@ -669,7 +669,14 @@ cd ${srcdir}
 > >  set fullsrcdir [pwd]
 > >  cd ${mydir}
 > >  
 > > -gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
 > > +# If the directory name contains a '+' we must escape it, adding a backslash.
 > > +# If not, the test below will fail because it will interpret the '+' as a 
 > > +# regexp operator. We use string_to_regexp for this purpose.
 > > +
 > > +gdb_test "cd ${fullsrcdir}" \
 > > +         "Working directory [string_to_regexp ${fullsrcdir}].*" \
 > > +         "cd to \${srcdir}"
 > > +
 > >  send_gdb "file ./gdb.base/compl\t"
 > >  sleep 1
 > >  gdb_expect  {
 > > 
 > > 
 > > 
 > 
 > -- 
 > Daniel Jacobowitz
 > MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-04-10 13:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 23:24 [RFC/TESTSUITE] completion.exp Elena Zannoni
2003-04-09 17:23 ` David Carlton
2003-04-09 20:14   ` Elena Zannoni
2003-04-09 20:35     ` David Carlton
2003-04-09 20:57     ` Daniel Jacobowitz
2003-04-10 13:38       ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox