This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Tighten regexp in gdb.base/setshow.exp
- From: "Andrew Burgess" <aburgess at broadcom dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 26 Nov 2013 16:11:09 +0000
- Subject: [PATCH] Tighten regexp in gdb.base/setshow.exp
- Authentication-results: sourceware.org; auth=none
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
}