Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH, testsuite] Avoid testsuite harness failure on i686-mingw32 host
Date: Fri, 16 Nov 2012 03:51:00 -0000	[thread overview]
Message-ID: <6BFC66D7-25FA-466A-9F9C-51AB52C24848@codesourcery.com> (raw)

[-- 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)" }
 	}
     }
 }

             reply	other threads:[~2012-11-16  3:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16  3:51 Maxim Kuvyrkov [this message]
2012-11-16  8:35 ` Eli Zaretskii
2012-11-23  4:33   ` Maxim Kuvyrkov
2012-11-23  5:05     ` Kai Tietz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6BFC66D7-25FA-466A-9F9C-51AB52C24848@codesourcery.com \
    --to=maxim@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox