Re: [PATCH] gdb.base/setshow.exp: fix racy tests (PR testsuite/12649)

Andreas Schwab
2011-04-19T20:28:55Z

Marek Polacek <mpolacek@redhat.com> writes:

> On 04/19/2011 08:46 PM, Tom Tromey wrote:
>> If I revert that hunk, it still works for me.
>> So, something else must be going on.
>
> Yes, but try running it without those "\\"s and _with_ read1()
> from:
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=12649
>
> I bet you will see those FAILs afterwards.

Obviously:

@@ -3719,7 +3719,8 @@ board_info target exists gdb,timeout
board_info target exists gdb,timeout
board_info host fileid
getting igel fileid
-set prompt (gdb) PASS: gdb.base/setshow.exp: set prompt gdb
+set prompt \(gdb\)
+(gdb) PASS: gdb.base/setshow.exp: set prompt gdb
Sending "set radix 11" to gdb
Looking to match ""[\r\n]*(Unsupported output radix ``decimal 11''; output radix unchanged..*)[\r\n]+\(gdb\) $"; "(^FOOBAR$)$""
Message is "set radix 11"

--- setshow.exp 1 Jan 2011 15:33:42 -0000 1.20
+++ setshow.exp 19 Apr 2011 20:25:09 -0000
@@ -197,7 +204,7 @@ if ![board_info target exists gdb_prompt
set newprompt "\\(FooBarBaz\\)"

gdb_test_multiple "set prompt (FooBarBaz) " "set prompt FooBarBaz" {
- -re "$newprompt $" {
+ -re "\[\r\n\]$newprompt $" {
pass "set prompt FooBarBaz"
}
}
@@ -213,7 +220,7 @@ if ![board_info target exists gdb_prompt
#test set prompt (gdb)

gdb_test_multiple "set prompt (gdb) " "set prompt gdb" {
- -re "$gdb_prompt $" {
+ -re "\[\r\n\]$gdb_prompt $" {
pass "set prompt gdb"
}
}

Andreas.

--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."