[gccgo] Minor testsuite harness fixes

Submitted by Ian Taylor on July 3, 2010, 12:22 a.m.

Details

Message ID mcreiflifci.fsf@google.com
State New
Headers show

Commit Message

Ian Taylor July 3, 2010, 12:22 a.m.
This patch from Vinu Rajashekhar fixes a couple of minor issues in the
gccgo testsuite harness in order to make it work better on RTEMS.  There
is no longer any need to cd into the directory before running the test.
Programs should be run via go_load rather than exec.  Committed to gccgo
branch.

Ian

Patch hide | download patch | download mbox

Index: gcc/testsuite/go.test/go-test.exp
===================================================================
--- gcc/testsuite/go.test/go-test.exp	(revision 161655)
+++ gcc/testsuite/go.test/go-test.exp	(working copy)
@@ -194,10 +194,8 @@ 
 			   "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >* || echo BUG*" \
 			   $test_line] } {
 	    # This is a vanilla execution test.
-	    cd [file dirname $test]
 	    go-torture-execute $test
 	    file delete core [glob -nocomplain core.*]
-	    cd $testdir
 	} elseif { [string match \
 			"// \$G \$D/\$F.go && \$L \$F.\$A || echo BUG*" \
 			$test_line] \
@@ -351,11 +349,9 @@ 
 				 $output_file "executable" "$DEFAULT_GOFLAGS"]
 	    set comp_output [go-dg-prune $target_triplet $comp_output]
 	    verbose -log $comp_output
-	    if { [catch "exec $output_file" ] != 0 } {
-		fail $name
-	    } else {
-		pass $name
-	    }
+	    set result [go_load "$output_file" "" ""]
+	    set status [lindex $result 0]
+	    $status $name
 	    file delete $ofile1 $ofile2 $output_file
 	    set runtests $hold_runtests
 	} elseif { [string match \