Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host
@ 2012-11-16  3:51 Maxim Kuvyrkov
  2012-11-16  8:35 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Kuvyrkov @ 2012-11-16  3:51 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

This patch improves testing on i686-mingw32 host.  One of the tests in interrupt.exp assumes that Control-D is EOF, which is not the case for Windows hosts.  After the test timeouts the testsuite doesn't get GDB prompt back, which causes all subsequent tests to fail.

OK to apply?

Thank you,

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics



[-- Attachment #2: gdb-win32-eof.ChangeLog --]
[-- Type: application/octet-stream, Size: 150 bytes --]

2012-11-15  Maxim Kuvyrkov  <maxim@codesourcery.com>

	gdb/testsuite/
	* gdb.base/interrupt.exp: Workaround problem of sending EOF on Windows
	hosts.

[-- Attachment #3: gdb-win32-eof.patch --]
[-- Type: application/octet-stream, Size: 1492 bytes --]

Index: gdb/testsuite/gdb.base/interrupt.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/interrupt.exp,v
retrieving revision 1.22
diff -u -p -r1.22 interrupt.exp
--- gdb/testsuite/gdb.base/interrupt.exp	16 Jan 2012 16:21:44 -0000	1.22
+++ gdb/testsuite/gdb.base/interrupt.exp	16 Nov 2012 03:43:06 -0000
@@ -194,14 +194,28 @@ if ![file exists $binfile] then {
 	    }
 	}
 
-	send_gdb "\004"
-	gdb_expect {
-	    -re "end of file.*$inferior_exited_re normally.*$gdb_prompt $" {
-		pass "send end of file"
+	# Control-D is not EOF on Windows hosts, so skip this test.
+	if { ! [ishost i686-*-mingw32] } {
+	    send_gdb "\004"
+	    gdb_expect {
+		-re "end of file.*$inferior_exited_re normally.*$gdb_prompt $" {
+		    pass "send end of file"
+		}
+		-re "$gdb_prompt $" { fail "send end of file" }
+		timeout { fail "send end of file (timeout)" }
+		eof { fail "send end of file (eof)" }
+	    }
+	} else {	
+	    # Interrupt GDB to get the prompt back.  Killing GDB while the
+	    # remote stub is waiting for file I/O may confuse it for future
+	    # tests.
+	    set msg "Send Control-C to get the prompt"
+	    send_gdb "\003"
+	    gdb_test_multiple "" "$msg" {
+		-re "Program received signal SIGINT.*$gdb_prompt $" {
+		    pass "$msg"
+		}
 	    }
-	    -re "$gdb_prompt $" { fail "send end of file" }
-	    timeout { fail "send end of file (timeout)" }
-	    eof { fail "send end of file (eof)" }
 	}
     }
 }

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

* Re: [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host
  2012-11-16  3:51 [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host Maxim Kuvyrkov
@ 2012-11-16  8:35 ` Eli Zaretskii
  2012-11-23  4:33   ` Maxim Kuvyrkov
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2012-11-16  8:35 UTC (permalink / raw)
  To: Maxim Kuvyrkov; +Cc: gdb-patches

> From: Maxim Kuvyrkov <maxim@codesourcery.com>
> Date: Fri, 16 Nov 2012 16:50:50 +1300
> 
> This patch improves testing on i686-mingw32 host.  One of the tests in interrupt.exp assumes that Control-D is EOF, which is not the case for Windows hosts.  After the test timeouts the testsuite doesn't get GDB prompt back, which causes all subsequent tests to fail.

Instead of sending Ctrl-C, isn't it better to send Ctrl-Z, which is
the Windows equivalent of the Posix Ctrl-D?


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

* Re: [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host
  2012-11-16  8:35 ` Eli Zaretskii
@ 2012-11-23  4:33   ` Maxim Kuvyrkov
  2012-11-23  5:05     ` Kai Tietz
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Kuvyrkov @ 2012-11-23  4:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 16/11/2012, at 9:34 PM, Eli Zaretskii wrote:

>> From: Maxim Kuvyrkov <maxim@codesourcery.com>
>> Date: Fri, 16 Nov 2012 16:50:50 +1300
>> 
>> This patch improves testing on i686-mingw32 host.  One of the tests in interrupt.exp assumes that Control-D is EOF, which is not the case for Windows hosts.  After the test timeouts the testsuite doesn't get GDB prompt back, which causes all subsequent tests to fail.
> 
> Instead of sending Ctrl-C, isn't it better to send Ctrl-Z, which is
> the Windows equivalent of the Posix Ctrl-D?

Hm, that's a thought.  I wonder if i686-mingw32-hosted GDB will correctly handle it.

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics


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

* Re: [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host
  2012-11-23  4:33   ` Maxim Kuvyrkov
@ 2012-11-23  5:05     ` Kai Tietz
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Tietz @ 2012-11-23  5:05 UTC (permalink / raw)
  To: Maxim Kuvyrkov; +Cc: Eli Zaretskii, gdb-patches

2012/11/23 Maxim Kuvyrkov <maxim@codesourcery.com>:
> On 16/11/2012, at 9:34 PM, Eli Zaretskii wrote:
>
>>> From: Maxim Kuvyrkov <maxim@codesourcery.com>
>>> Date: Fri, 16 Nov 2012 16:50:50 +1300
>>>
>>> This patch improves testing on i686-mingw32 host.  One of the tests in interrupt.exp assumes that Control-D is EOF, which is not the case for Windows hosts.  After the test timeouts the testsuite doesn't get GDB prompt back, which causes all subsequent tests to fail.
>>
>> Instead of sending Ctrl-C, isn't it better to send Ctrl-Z, which is
>> the Windows equivalent of the Posix Ctrl-D?
>
> Hm, that's a thought.  I wonder if i686-mingw32-hosted GDB will correctly handle it.

Sure, Ctrl-Z (F6) is the proper thing to use.

Kai


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

end of thread, other threads:[~2012-11-23  5:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16  3:51 [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host Maxim Kuvyrkov
2012-11-16  8:35 ` Eli Zaretskii
2012-11-23  4:33   ` Maxim Kuvyrkov
2012-11-23  5:05     ` Kai Tietz

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