]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - binutils/testsuite/lib/utils-lib.exp
Imported binutils-2.20
[msp430-binutils.git] / binutils / testsuite / lib / utils-lib.exp
index 77af1721efdd6795e20c61c3a17c55f559e5e132..9881f0133f4a6b4f847d30d843371bb9bf5a14e3 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007
-# Free Software Foundation, Inc.
+# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
+# 2009 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -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