Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Tighten regexp in gdb.base/setshow.exp
@ 2013-11-26 16:28 Andrew Burgess
  2013-11-26 16:35 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2013-11-26 16:28 UTC (permalink / raw)
  To: gdb-patches

Had a random test failure in gdb.base/setshow.exp caused by $gdb_prompt
not being used on the end of a regexp for gdb_test_multiple.

Fixed in the two obvious places.  Other uses of gdb_test_multiple in
this file are messing with the prompt so I've left them alone.

OK to apply?

Thanks,
Andrew

gdb/testsuite/ChangeLog

2013-11-26  Andrew Burgess  <aburgess@broadcom.com>

	* gdb.base/setshow.exp: Add $gdb_prompt to the patterns in
	gdb_test_multiple.

diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index d9e71d3..21df262 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -169,7 +169,7 @@ gdb_test "show history expansion on" "History expansion on command input is on.*
 set HOME ""
 set test "show environment HOME"
 gdb_test_multiple $test $test {
-    -re "\nHOME = (.*).\n.*" {
+    -re "\nHOME = (\[^\n\r\]*)\[\r\n\]+$gdb_prompt $" {
         set HOME $expect_out(1,string)
         pass $test
     }
@@ -185,7 +185,7 @@ gdb_test "show history filename" \
 set PWD ""
 set test "show working directory"
 gdb_test_multiple "pwd" $test {
-    -re "\nWorking directory (.*)..\n.*" {
+    -re "\nWorking directory (\[^\n\r\]*)\\.\[\r\n\]+$gdb_prompt $" {
         set PWD $expect_out(1,string)
         pass $test
     }


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

* Re: [PATCH] Tighten regexp in gdb.base/setshow.exp
  2013-11-26 16:28 [PATCH] Tighten regexp in gdb.base/setshow.exp Andrew Burgess
@ 2013-11-26 16:35 ` Pedro Alves
  2013-11-26 21:14   ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2013-11-26 16:35 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

On 11/26/2013 04:11 PM, Andrew Burgess wrote:
> 
> 2013-11-26  Andrew Burgess  <aburgess@broadcom.com>
> 
> 	* gdb.base/setshow.exp: Add $gdb_prompt to the patterns in
> 	gdb_test_multiple.

OK, thanks.

> +    -re "\nHOME = (\[^\n\r\]*)\[\r\n\]+$gdb_prompt $" {

Any reason to write \n\r instead of the more usual \r\n though ?

-- 
Pedro Alves


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

* Re: [PATCH] Tighten regexp in gdb.base/setshow.exp
  2013-11-26 16:35 ` Pedro Alves
@ 2013-11-26 21:14   ` Andrew Burgess
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2013-11-26 21:14 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 26/11/2013 4:14 PM, Pedro Alves wrote:
> On 11/26/2013 04:11 PM, Andrew Burgess wrote:
>>
>> 2013-11-26  Andrew Burgess  <aburgess@broadcom.com>
>>
>> 	* gdb.base/setshow.exp: Add $gdb_prompt to the patterns in
>> 	gdb_test_multiple.
> 
> OK, thanks.
> 
>> +    -re "\nHOME = (\[^\n\r\]*)\[\r\n\]+$gdb_prompt $" {
> 
> Any reason to write \n\r instead of the more usual \r\n though ?

No, just my fingers.  I've switched them to "\r\n" in the version
I just pushed.

Thanks,
Andrew




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

end of thread, other threads:[~2013-11-26 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 16:28 [PATCH] Tighten regexp in gdb.base/setshow.exp Andrew Burgess
2013-11-26 16:35 ` Pedro Alves
2013-11-26 21:14   ` Andrew Burgess

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