diff mbox

Go testsuite patch committed: compiledir fix

Message ID mcrk378jbs8.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor July 20, 2014, 3:21 p.m. UTC
This patch to the Go testsuite driver adds support for having multiple
files in a single package for a compiledir test.  Ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2014-07-20  Ian Lance Taylor  <iant@google.com>

	* go.test/go-test.exp (go-gc-tests): Support multiple files in one
	package for compiledir tests.
diff mbox

Patch

Index: go-test.exp
===================================================================
--- go-test.exp	(revision 212213)
+++ go-test.exp	(working copy)
@@ -651,13 +651,17 @@  proc go-gc-tests { } {
 	    set runtests "go-test.exp"
 	    set dg-do-what-default "assemble"
 	    set dir "[file rootname $test].dir"
-	    set del {}
-	    foreach f [lsort [glob "$dir/*.go"]] {
-		dg-test -keep-output $f "-O" "-w $DEFAULT_GOCFLAGS"
-		lappend del "[file rootname [file tail $f]].o"
-	    }
-	    foreach f $del {
-		file delete $f
+	    set files [lsort [glob "$dir/*.go"]]
+	    set packages [go-find-packages $test $name $files]
+	    if { [llength $packages] > 0 } {
+		set del [list]
+		foreach p $packages {
+		    dg-test -keep-output [lindex $p 1] "[lrange $p 2 end] -O" "-w $DEFAULT_GOCFLAGS"
+		    lappend del "[file rootname [file tail [lindex $p 1]]].o"
+		}
+		foreach f $del {
+		    file delete $f
+		}
 	    }
 	    set runtests $hold_runtests
 	} elseif { $test_line == "// rundir" } {