2004-07-13 Andrew Cagney <cagney@gnu.org>

* gdb.base/sizeof.exp: Skip test when no inferior I/O.
	(check_sizeof, check_valueof): Do not include the output in the
	test name.  Use gdb_test.
	(get_valueof): Use gdb_test_multiple.
This commit is contained in:
Andrew Cagney 2004-07-13 17:08:36 +00:00
parent ceb78239b9
commit 6bf46641b8
2 changed files with 17 additions and 33 deletions

View File

@ -1,5 +1,10 @@
2004-07-13 Andrew Cagney <cagney@gnu.org>
* gdb.base/sizeof.exp: Skip test when no inferior I/O.
(check_sizeof, check_valueof): Do not include the output in the
test name. Use gdb_test.
(get_valueof): Use gdb_test_multiple.
* gdb.base/step-test.exp: Update copyright. Use
gdb_test_multiple. Ensure that test names do not include
architecture dependent output.

View File

@ -16,6 +16,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
if [target_info exists gdb,noinferiorio] {
verbose "Skipping fileio.exp because of no fileio capabilities."
continue
}
if $tracelevel {
strace $tracelevel
}
@ -57,15 +62,13 @@ if ![runto_main] then {
proc get_valueof { fmt exp default } {
global gdb_prompt
send_gdb "print${fmt} ${exp}\n"
gdb_expect {
set test "get valueof \"${exp}\""
set val ${default}
gdb_test_multiple "print${fmt} ${exp}" "$test" {
-re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
set val $expect_out(1,string)
pass "get value of ${exp} ($val)"
}
timeout {
set size ${default}
fail "get value of ${exp} (timeout)"
pass "$test ($val)"
}
}
return ${val}
@ -97,17 +100,8 @@ set sizeof_long_double [get_sizeof "long double" 8]
proc check_sizeof { type size } {
global gdb_prompt
if [gdb_skip_stdio_test "check sizeof $type == $size"] {
return;
}
set pat [string_to_regexp "sizeof (${type}) == ${size}"]
set test "check sizeof ${type}"
gdb_test_multiple "next" "$test" {
-re "${pat}\[\r\n\].*$gdb_prompt $" {
pass "$test"
}
}
gdb_test "next" "${pat}\[\r\n\]+\[0-9\].*" "check sizeof \"$type\""
}
check_sizeof "char" ${sizeof_char}
@ -126,23 +120,8 @@ check_sizeof "long double" ${sizeof_long_double}
proc check_valueof { exp val } {
global gdb_prompt
if [gdb_skip_stdio_test "check valueof $exp == $val"] {
return;
}
set pat [string_to_regexp "valueof (${exp}) == ${val}"]
send_gdb "next\n"
gdb_expect {
-re "${pat}\[\r\n\].*$gdb_prompt $" {
pass "check valueof ${exp} == ${val}"
}
-re ".*$gdb_prompt $" {
fail "check valueof ${exp} == ${val}"
}
timeout {
fail "check valueof ${exp} == ${val} (timeout)"
}
}
gdb_test "next" "${pat}\[\r\n\]+\[0-9\].*" "check valueof \"$exp\""
}
# Check that GDB and the target agree over the sign of a character.