aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/testsuite/ChangeLog17
-rw-r--r--binutils/testsuite/binutils-all/ar.exp3
-rw-r--r--binutils/testsuite/binutils-all/arm/objdump.exp2
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp23
-rw-r--r--binutils/testsuite/binutils-all/readelf.exp16
-rw-r--r--binutils/testsuite/lib/utils-lib.exp15
6 files changed, 55 insertions, 21 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 46ba568..c1fcd3c 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2007-08-28 Mark Shinwell <shinwell@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * binutils-all/ar.exp (long_filenames): Delete temporary files on
+ the host.
+ * binutils-all/arm/objdump.exp: Only check "which $OBJDUMP" if
+ host is local.
+ * binutils-all/objcopy.exp: Use ${srecfile} to get the name of the
+ srec file to be passed to binutils_run.
+ (objcopy_test_readelf): Use remote_exec.
+ * binutils-all/readelf.exp (readelf_find_size): Use remote_exec.
+ (readelf_test): Likewise.
+ (readelf_wi_test): Likewise.
+ * lib/utils-lib.exp (run_dump_test): Only check "which $binary" if
+ host is local. Use remote_exec. Use $tempfile not
+ tmpdir/bintest.o.
+
2007-08-09 Alan Modra <amodra@bigpond.net.au>
* binutils-all/copy-2.d (not-target): Match *-*-*aout.
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index f90fed8..67504c3 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -42,6 +42,7 @@ proc long_filenames { } {
set file2 tmpdir/$n2
remote_file build delete $file1
+ remote_file host delete $n1
# Some file systems truncate file names at 14 characters, which
# makes it impossible to run this test. Check for that now.
@@ -54,8 +55,8 @@ proc long_filenames { } {
puts $f "first"
close $f
-
remote_file build delete $file2
+ remote_file host delete $n2
set status [catch "set f [open tmpdir/$n2 w]" errs]
if { $status != 0 } {
diff --git a/binutils/testsuite/binutils-all/arm/objdump.exp b/binutils/testsuite/binutils-all/arm/objdump.exp
index 226363b..8e435eb 100644
--- a/binutils/testsuite/binutils-all/arm/objdump.exp
+++ b/binutils/testsuite/binutils-all/arm/objdump.exp
@@ -19,7 +19,7 @@ if {![istarget "arm*-*-*"]} then {
return
}
-if {[which $OBJDUMP] == 0} then {
+if {![is_remote host] && [which $OBJDUMP] == 0} then {
perror "$OBJDUMP does not exist"
return
}
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index e05e622..8c232d0 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -194,7 +194,7 @@ if ![string match "" $got] then {
verbose $line
fail "objcopy -O srec"
} else {
- set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f ${copyfile}.srec"]
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f ${srecfile}"]
if ![regexp "file format srec" $got] then {
send_log "objdump failed\n"
fail "objcopy -O srec"
@@ -722,23 +722,32 @@ proc objcopy_test_readelf {testname srcfile} {
}
verbose -log "$OBJCOPY $OBJCOPYFLAGS tmpdir/bintest.o tmpdir/copy.o"
- catch "exec $OBJCOPY $OBJCOPYFLAGS tmpdir/bintest.o tmpdir/copy.o" exec_output
- if ![string match "" $exec_output] then {
+ set exec_output [remote_exec host "$OBJCOPY $OBJCOPYFLAGS tmpdir/bintest.o tmpdir/copy.o"]
+ if { [lindex $exec_output 0] != 0
+ || ![string match "" [lindex $exec_output 1]] } then {
fail "objcopy ($testname)"
return
}
verbose -log "$READELF -a tmpdir/bintest.o > tmpdir/bintest.o.out"
- catch "exec $READELF -a tmpdir/bintest.o > tmpdir/bintest.o.out" exec_output
- set exec_output [prune_warnings $exec_output]
+ set exec_output [remote_exec host "$READELF -a tmpdir/bintest.o" "" "/dev/null" "tmpdir/bintest.o.out"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "objcopy ($testname)"
+ return
+ }
+ set exec_output [prune_warnings [lindex $exec_output 1]]
if ![string match "" $exec_output] then {
unresolved "objcopy ($testname)"
return
}
verbose -log "$READELF -a tmpdir/copy.o > tmpdir/copy.o.out"
- catch "exec $READELF -a tmpdir/copy.o > tmpdir/copy.o.out" exec_output
- set exec_output [prune_warnings $exec_output]
+ set exec_output [remote_exec host "$READELF -a tmpdir/copy.o" "" "/dev/null" "tmpdir/copy.o.out"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "objcopy ($testname)"
+ return
+ }
+ set exec_output [prune_warnings [lindex $exec_output 1]]
if ![string match "" $exec_output] then {
unresolved "objcopy ($testname)"
return
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 2979cfd..d8ba1c0 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -41,9 +41,12 @@ proc readelf_find_size { binary_file } {
set readelf_size ""
set testname "finding out ELF size with readelf -h"
- catch "exec $READELF $READELFFLAGS -h $binary_file > readelf.out" got
+ set got [remote_exec host "$READELF $READELFFLAGS -h $binary_file" "" "/dev/null" "readelf.out"]
+ if [is_remote host] then {
+ remote_upload host "readelf.out"
+ }
- if ![string match "" $got] then {
+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]]} then {
send_log $got
fail $testname
return
@@ -76,13 +79,13 @@ proc readelf_test { options binary_file regexp_file xfails } {
global subdir
send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n"
- catch "exec $READELF $READELFFLAGS $options $binary_file > readelf.out" got
+ set got [remote_exec host "$READELF $READELFFLAGS $options $binary_file" "" "/dev/null" "readelf.out"]
foreach xfail $xfails {
setup_xfail $xfail
}
- if ![string match "" $got] then {
+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
fail "readelf $options (reason: unexpected output)"
send_log $got
send_log "\n"
@@ -146,8 +149,7 @@ proc readelf_wi_test {} {
set tempfile [remote_download host tmpdir/testprog.o]
# Run "readelf -wi" on it.
- send_log "exec $READELF $READELFFLAGS -wi $tempfile > readelf.out\n"
- catch "exec $READELF $READELFFLAGS -wi $tempfile > readelf.out" got
+ set got [remote_exec host "$READELF $READELFFLAGS -wi $tempfile" "" "/dev/null" "readelf.out"]
# Upload the results.
set output [remote_upload host readelf.out]
@@ -155,7 +157,7 @@ proc readelf_wi_test {} {
file_on_host delete $tempfile
# Strip any superflous warnings.
- set got [prune_readelf_wi_warnings $got]
+ set got [prune_readelf_wi_warnings [lindex $got 1]]
if ![string match "" $got] then {
fail "readelf $READELFFLAGS -wi (reason: unexpected output)"
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index 77af172..8ed9330 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -462,7 +462,7 @@ proc run_dump_test { name {extra_options {}} } {
set srcfile $srcdir/$subdir/$opts(source)
}
- set exec_output [binutils_assemble ${srcfile} tmpdir/bintest.o]
+ set exec_output [binutils_assemble ${srcfile} $tempfile]
if [string match "" $exec_output] then {
send_log "$exec_output\n"
verbose "$exec_output"
@@ -486,14 +486,14 @@ proc run_dump_test { name {extra_options {}} } {
eval set progopts \$[string toupper $dumpprogram]FLAGS
eval set binary \$[string toupper $dumpprogram]
- if { [which $binary] == 0 } {
+ if { ![is_remote host] && [which $binary] == 0 } {
untested $testname
return
}
verbose "running $binary $progopts $progopts1" 3
- set cmd "$binary $progopts $progopts1 ${copyfile}.o > tmpdir/dump.out"
+ set cmd "$binary $progopts $progopts1 ${copyfile}.o"
# Ensure consistent sorting of symbols
if {[info exists env(LC_ALL)]} {
@@ -501,13 +501,18 @@ proc run_dump_test { name {extra_options {}} } {
}
set env(LC_ALL) "C"
send_log "$cmd\n"
- catch "exec $cmd" comp_output
+ set comp_output [remote_exec host $cmd "" "/dev/null" "tmpdir/dump.out"]
if {[info exists old_lc_all]} {
set env(LC_ALL) $old_lc_all
} else {
unset env(LC_ALL)
}
- set comp_output [prune_warnings $comp_output]
+ if { [lindex $comp_output 0] != 0 } then {
+ send_log "$comp_output\n"
+ fail $testname
+ return
+ }
+ set comp_output [prune_warnings [lindex $comp_output 1]]
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
fail $testname