Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb.mi/mi-nonstop-exit.exp: fix racy test (PR testsuite/12649)
@ 2011-05-17 18:38 Marek Polacek
  2011-05-19  9:06 ` Marek Polacek
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2011-05-17 18:38 UTC (permalink / raw)
  To: gdb-patches

I've changed the gdb_test_multiple to ugly send_gdb+gdb_expect, since 
we must not use the gdb_test_multiple (see PR 12647).  Here, I think,
it is not possible to use the mi_gdb_test, because mi_gdb_test either PASSes,
or FAILs, but in the `-gdb-show non-stop' test, we have to use the
`$expect_out' and possibly set the `supported' variable iff in the gdb output
is "supported=*".
Otherwise, if the output is just the "^done,value="off"", it is still OK, we
just don't use `$expect_out'.  Otherwise, this test FAILs.  That said, this
test never PASSes, it can only fail.

Using the send_gdb+gdb_expect in place of the gdb_test_multiple cures a race,
the problem is with the trailing ^M, as shown in PR 12647.

Thus, I propose this patch.  Tested with both read{,1}.  OK?

2011-05-17  Marek Polacek  <mpolacek@redhat.com>

        * gdb.mi/i-nonstop-exit.exp: Use the send_gdb+gdb_expect instead of
        the gdb_test_multiple.

--- gdb/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp.mp     2011-01-01 16:33:47.000000000 +0100
+++ gdb/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp        2011-05-17 20:32:52.708217970 +0200
@@ -37,13 +37,17 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load $binfile
 
 set supported 0
-gdb_test_multiple "-gdb-show non-stop" "" {
-    -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
+send_gdb "-gdb-show non-stop\n"
+gdb_expect {
+    -re "\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
         if { $expect_out(1,string) == "1" } { 
             set supported 1
         }   
     }   
+    -re "\\^done,value=\"off\"\r\n$mi_gdb_prompt$" {
+    }
     -re ".*$mi_gdb_prompt$" {
+       fail "-gdb-show non-stop"
     }   
 }


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

* Re: [PATCH] gdb.mi/mi-nonstop-exit.exp: fix racy test (PR testsuite/12649)
  2011-05-17 18:38 [PATCH] gdb.mi/mi-nonstop-exit.exp: fix racy test (PR testsuite/12649) Marek Polacek
@ 2011-05-19  9:06 ` Marek Polacek
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Polacek @ 2011-05-19  9:06 UTC (permalink / raw)
  To: gdb-patches

On 05/17/2011 08:37 PM, Marek Polacek wrote:
> I've changed the gdb_test_multiple to ugly send_gdb+gdb_expect, since 
> we must not use the gdb_test_multiple (see PR 12647).  Here, I think,
> it is not possible to use the mi_gdb_test, because mi_gdb_test either PASSes,
> or FAILs, but in the `-gdb-show non-stop' test, we have to use the
> `$expect_out' and possibly set the `supported' variable iff in the gdb output
> is "supported=*".

The exactly same testcase is also in the mi-nonstop.exp.

> 2011-05-17  Marek Polacek  <mpolacek@redhat.com>
> 
>         * gdb.mi/i-nonstop-exit.exp: Use the send_gdb+gdb_expect instead of			
		   ^ missing `m', fixed.


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

end of thread, other threads:[~2011-05-19  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 18:38 [PATCH] gdb.mi/mi-nonstop-exit.exp: fix racy test (PR testsuite/12649) Marek Polacek
2011-05-19  9:06 ` Marek Polacek

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