This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] testsuite FAIL message cleanups
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 03 Apr 2003 11:37:11 -0500
- Subject: [commit] testsuite FAIL message cleanups
Hello,
Attatched is a bunch of cleanups to random tests:
- unique names
- more consistent output (fail reason in paren)
- better patterns
They only really help when the target falls over big time.
committed,
Andrew
2003-04-02 Andrew Cagney <cagney at redhat dot com>
* gdb.base/callfuncs.exp: Make "print add" messages unique.
* gdb.base/ending-run.exp: Put spaces around "breakpoint" to stop
matching directories by the name breakpoint.
* gdb.base/pointers.exp: Make "ptype pppC" message consistent.
Make "continue to marker1" consistent.
* gdb.base/call-rt-st.exp: Make "finish out from loop_count"
message consistent.
* lib/gdb.exp: Put "the program is no longer running", and "the
program exited" in parenthesis.
* lib/mi-support.exp: Ditto.
Index: gdb.base/call-rt-st.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-rt-st.exp,v
retrieving revision 1.11
diff -u -r1.11 call-rt-st.exp
--- gdb.base/call-rt-st.exp 27 May 2002 02:03:35 -0000 1.11
+++ gdb.base/call-rt-st.exp 3 Apr 2003 16:33:06 -0000
@@ -128,12 +128,18 @@
send_gdb "finish\n"
gdb_expect {
- -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:617\[ \t\r\n\]+617\[\t \]+return 0;.*$gdb_prompt $" {
- pass "finish out from loop_count (line 617)"}
- -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:615\[ \t\r\n\]+615\[\t \]+loop_count.*$gdb_prompt $" {
- pass "finish out from loop_count (line 615)"}
- -re ".*$gdb_prompt $" { fail "finish out from loop_count"}
- timeout { fail "(timeout)finish out from loop_count"}
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:617\[ \t\r\n\]+617\[\t \]+return 0;.*$gdb_prompt $" {
+ pass "finish out from loop_count (line 617)"
+ }
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:615\[ \t\r\n\]+615\[\t \]+loop_count.*$gdb_prompt $" {
+ pass "finish out from loop_count (line 615)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish out from loop_count"
+ }
+ timeout {
+ fail "finish out from loop_count (timeout)"
+ }
}
# Ask GDB to print the value of EXPR, and expect to see the regexp
Index: gdb.base/callfuncs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
retrieving revision 1.10
diff -u -r1.10 callfuncs.exp
--- gdb.base/callfuncs.exp 4 Jan 2003 22:37:49 -0000 1.10
+++ gdb.base/callfuncs.exp 3 Apr 2003 16:33:06 -0000
@@ -342,7 +342,8 @@
# Call function (causing a breakpoint hit in the call dummy) and do a finish,
# make sure we are back at main and still have the same register contents.
-gdb_test "print add(4,5)" "The program being debugged stopped while.*" ""
+gdb_test "print add(4,5)" "The program being debugged stopped while.*" \
+ "call function causing a breakpoint then do a finish"
gdb_test "finish" \
"Value returned is .* = 9" \
"finish from call dummy breakpoint returns correct value"
@@ -360,7 +361,8 @@
# Call function (causing a breakpoint hit in the call dummy) and do a return
# with a value, make sure we are back at main with the same register contents.
-gdb_test "print add(4,5)" "The program being debugged stopped while.*" ""
+gdb_test "print add(4,5)" "The program being debugged stopped while.*" \
+ "call function causing a breakpoint and then do a return"
if ![gdb_test "return 7" \
"#0 main.*" \
"back at main after return from call dummy breakpoint" \
Index: gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.20
diff -u -r1.20 ending-run.exp
--- gdb.base/ending-run.exp 20 Mar 2003 14:10:17 -0000 1.20
+++ gdb.base/ending-run.exp 3 Apr 2003 16:33:06 -0000
@@ -74,7 +74,7 @@
gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
send_gdb "i b\n"
gdb_expect {
- -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
+ -re ".* breakpoint .* breakpoint .*$gdb_prompt $" {
fail "cleared bp at line before routine"
}
-re ".*3.*main.*31.*$gdb_prompt $" {
@@ -120,7 +120,7 @@
send_gdb "i b\n"
gdb_expect {
- -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
+ -re ".* breakpoint .* breakpoint .*$gdb_prompt $" {
fail "all set to continue (didn't clear bps)"
}
-re ".*3.*main.*31.*$gdb_prompt $" {
Index: gdb.base/pointers.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pointers.exp,v
retrieving revision 1.5
diff -u -r1.5 pointers.exp
--- gdb.base/pointers.exp 7 Mar 2001 17:21:43 -0000 1.5
+++ gdb.base/pointers.exp 3 Apr 2003 16:33:06 -0000
@@ -366,23 +366,28 @@
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
- send_gdb "cont\n"
- gdb_expect {
- -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
- send_gdb "up\n"
- gdb_expect {
- -re ".*more_code.*$gdb_prompt $" {
- pass "up from marker1"
- }
- -re ".*$gdb_prompt $" {
- fail "up from marker1"
- }
- timeout { fail "up from marker1 (timeout)" }
- }
- }
- -re "$gdb_prompt $" { fail "continue to marker1" }
- timeout { fail "(timeout) continue to marker1" }
+send_gdb "cont\n"
+gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ pass "continue to marker1"
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*more_code.*$gdb_prompt $" {
+ pass "up from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "up from marker1"
+ }
+ timeout { fail "up from marker1 (timeout)" }
+ }
+ }
+ -re "$gdb_prompt $" {
+ fail "continue to marker1"
}
+ timeout {
+ fail "continue to marker1 (timeout)"
+ }
+}
send_gdb "print *pUC\n"
@@ -568,7 +573,7 @@
send_gdb "ptype pppC\n"
gdb_expect {
- -re "type = char \\*\\*\\*.*$gdb_prompt $" { pass "ptype pppC" }
+ -re "type = char \\*\\*\\*.*$gdb_prompt $" { pass "ptype pppC" }
-re ".*$gdb_prompt $" { fail "ptype pppC" }
timeout { fail "(timeout) ptype pppC" }
}
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.35
diff -u -r1.35 gdb.exp
--- lib/gdb.exp 23 Feb 2003 22:11:07 -0000 1.35
+++ lib/gdb.exp 3 Apr 2003 16:33:06 -0000
@@ -541,27 +541,27 @@
}
-re "Program exited with code \[0-9\]+.*$gdb_prompt $" {
if ![string match "" $message] then {
- set errmsg "$message: the program exited"
+ set errmsg "$message (the program exited)"
} else {
- set errmsg "$command: the program exited"
+ set errmsg "$command (the program exited)"
}
fail "$errmsg"
set result -1
}
-re "EXIT code \[0-9\r\n\]+Program exited normally.*$gdb_prompt $" {
if ![string match "" $message] then {
- set errmsg "$message: the program exited"
+ set errmsg "$message (the program exited)"
} else {
- set errmsg "$command: the program exited"
+ set errmsg "$command (the program exited)"
}
fail "$errmsg"
set result -1
}
-re "The program is not being run.*$gdb_prompt $" {
if ![string match "" $message] then {
- set errmsg "$message: the program is no longer running"
+ set errmsg "$message (the program is no longer running)"
} else {
- set errmsg "$command: the program is no longer running"
+ set errmsg "$command (the program is no longer running)"
}
fail "$errmsg"
set result -1
Index: lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.21
diff -u -r1.21 mi-support.exp
--- lib/mi-support.exp 31 Jan 2003 13:11:26 -0000 1.21
+++ lib/mi-support.exp 3 Apr 2003 16:33:07 -0000
@@ -549,18 +549,18 @@
}
-re "Program exited with code \[0-9\]+.*$mi_gdb_prompt\[ \]*$" {
if ![string match "" $message] then {
- set errmsg "$message: the program exited"
+ set errmsg "$message (the program exited)"
} else {
- set errmsg "$command: the program exited"
+ set errmsg "$command (the program exited)"
}
fail "$errmsg"
return -1
}
-re "The program is not being run.*$mi_gdb_prompt\[ \]*$" {
if ![string match "" $message] then {
- set errmsg "$message: the program is no longer running"
+ set errmsg "$message (the program is no longer running)"
} else {
- set errmsg "$command: the program is no longer running"
+ set errmsg "$command (the program is no longer running)"
}
fail "$errmsg"
return -1