From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test
Date: Wed, 19 May 2010 20:54:00 -0000 [thread overview]
Message-ID: <4BF4497E.9040209@vmware.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: v.exp.txt --]
[-- Type: text/plain, Size: 6287 bytes --]
2010-05-19 Michael Snyder <msnyder@vmware.com>
* gdb.base/varargs.exp: Replace send_gdb with gdb_test.
* gdb.base/volatile.exp: Replace send_gdb with gdb_test.
Index: varargs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/varargs.exp,v
retrieving revision 1.12
diff -u -p -r1.12 varargs.exp
--- varargs.exp 5 May 2010 18:06:58 -0000 1.12
+++ varargs.exp 19 May 2010 20:23:15 -0000
@@ -62,9 +62,13 @@ gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
-send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
-send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+gdb_test "set print sevenbit-strings" "" \
+ "set print sevenbit-strings; ${testfile}"
+gdb_test "set print address off" "" \
+ "set print address off; ${testfile}"
+gdb_test "set width 0" "" \
+ "set width 0; ${testfile}"
+
if [gdb_skip_stdio_test "varargs.exp"] {
# Nothing in this module is testable without printf.
@@ -89,57 +93,25 @@ if { $hp_aCC_compiler } {
gdb_test "set overload-resolution 0" ""
}
-send_gdb "print find_max1(5,1,2,3,4,5)\n"
-gdb_expect {
- -re ".*find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5.*$gdb_prompt $" {
- pass "print find_max1(5,1,2,3,4,5)"
- }
- -re ".*$gdb_prompt $" { fail "print find_max1(5,1,2,3,4,5)" }
- timeout { fail "(timeout) print find_max1(5,1,2,3,4,5)" }
- }
-
-
-
-
-send_gdb "print find_max1(1,3)\n"
-gdb_expect {
- -re ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" {
- pass "print find_max1(1,3)"
- }
- -re ".*$gdb_prompt $" { fail "print find_max1(1,3)" }
- timeout { fail "(timeout) print find_max1(1,3)" }
- }
-
-
-send_gdb "print find_max1(10,1,2,3,4,5,6,7,8,29,0)\n"
-gdb_expect {
- -re ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29.*$gdb_prompt $" {
- pass "print find_max1(10,1,2,3,4,5,6,7,8,29,0)"
- }
- -re ".*$gdb_prompt $" { fail "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" }
- timeout { fail "(timeout) print find_max1(10,1,2,3,4,5,6,7,8,29,0)" }
- }
-
-
-
-send_gdb "print find_max2(3,1,2,3)\n"
-gdb_expect {
- -re ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" {
- pass "print find_max2(3,1,2,3)"
- }
- -re ".*$gdb_prompt $" { fail "print find_max2(3,1,2,3)" }
- timeout { fail "(timeout) print find_max2(3,1,2,3)" }
- }
-
+gdb_test "print find_max1(5,1,2,3,4,5)" \
+ "find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5" \
+ "print find_max1(5,1,2,3,4,5)"
+
+gdb_test "print find_max1(1,3)" \
+ ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \
+ "print find_max1(1,3)"
+
+gdb_test "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" \
+ ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29" \
+ "print find_max1(10,1,2,3,4,5,6,7,8,29,0)"
+
+gdb_test "print find_max2(3,1,2,3)" \
+ ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \
+ "print find_max2(3,1,2,3)"
if {![target_info exists gdb,skip_float_tests]} {
- send_gdb "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)\n"
- gdb_expect {
- -re ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17.*$gdb_prompt $" {
- pass "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)"
- }
- -re ".*$gdb_prompt $" { fail "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" }
- timeout { fail "(timeout) print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" }
- }
+ gdb_test "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" \
+ ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17" \
+ "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)"
}
Index: volatile.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/volatile.exp,v
retrieving revision 1.18
diff -u -p -r1.18 volatile.exp
--- volatile.exp 5 May 2010 18:06:58 -0000 1.18
+++ volatile.exp 19 May 2010 20:23:15 -0000
@@ -87,28 +87,17 @@ proc local_compiler_xfail_check_2 { } {
}
}
-send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+gdb_test "break marker1" "" ""
- send_gdb "cont\n"
- gdb_expect {
- -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
- send_gdb "up\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "up from marker1" }
- }
- }
- -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
- fail "continue to marker1 (demangling)"
- send_gdb "up\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "up from marker1" }
- }
- }
- -re "$gdb_prompt $" { fail "continue to marker1" }
- timeout { fail "(timeout) continue to marker1" }
+gdb_test_multiple "cont" "continue to marker1" {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ pass "continue to marker1"
}
+ -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ fail "continue to marker1 (demangling)"
+ }
+}
+gdb_test "up" " in main .*" "up from marker1"
# As of Feb 1999, GCC does not issue info about volatility of vars, so
# these tests are all expected to fail if GCC is the compiler. -sts
@@ -248,11 +237,7 @@ gdb_test "ptype vendor" "type = const vo
# test function parameters
local_compiler_xfail_check
local_compiler_xfail_check_2
-send_gdb "ptype qux2\n"
-gdb_expect {
- -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" {
- pass "ptype qux2"
- }
- -re ".*$gdb_prompt $" { fail "ptype qux2" }
- timeout { fail "(timeout) ptype qux2" }
- }
+
+gdb_test "ptype qux2" \
+ "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" \
+ "ptype qux2"
next reply other threads:[~2010-05-19 20:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 20:54 Michael Snyder [this message]
2010-05-20 16:13 ` Joel Brobecker
2010-05-20 16:31 ` Pedro Alves
2010-05-20 16:42 ` Joel Brobecker
2010-05-20 16:47 ` Pedro Alves
2010-05-20 17:09 ` Joel Brobecker
2010-05-20 17:57 ` Pedro Alves
2010-05-20 18:08 ` Michael Snyder
2010-05-20 19:45 ` [commit/testsuite] lib/gdb.exp: New gdb_test_no_output function Joel Brobecker
2010-05-20 18:04 ` [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test Michael Snyder
2010-05-20 18:40 ` Joel Brobecker
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=4BF4497E.9040209@vmware.com \
--to=msnyder@vmware.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