From: Shenghou Ma Date: Wed, 1 Aug 2012 03:26:33 +0000 (-0400) Subject: test/run.go: fix compiledir test on windows X-Git-Tag: go1.1rc2~2725 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8dbeb0ad072354e84463f38aef790cc1d69352e2;p=gostls13.git test/run.go: fix compiledir test on windows we can't import "./bug0" on windows, as it will trigger "import path contains invalid character ':'" error. instead, we pass "-D." and "-I." to gc to override this behavior. this idea is due to remyoudompheng. R=golang-dev, r, alex.brainman, remyoudompheng CC=golang-dev https://golang.org/cl/6441074 --- diff --git a/test/run.go b/test/run.go index e1d97e9eef..2b26a5b010 100644 --- a/test/run.go +++ b/test/run.go @@ -172,7 +172,7 @@ type test struct { donec chan bool // closed when done src string - action string // "compile", "build", "run", "errorcheck", "skip", "runoutput" + action string // "compile", "build", "run", "errorcheck", "skip", "runoutput", "compiledir" tempDir string err error @@ -315,7 +315,7 @@ func (t *test) run() { } for _, gofile := range files { afile := strings.Replace(gofile.Name(), ".go", "."+letter, -1) - out, err := runcmd("go", "tool", gc, "-e", "-o", afile, filepath.Join(longdir, gofile.Name())) + out, err := runcmd("go", "tool", gc, "-e", "-D.", "-I.", "-o", afile, filepath.Join(longdir, gofile.Name())) if err != nil { t.err = fmt.Errorf("%s\n%s", err, out) break