mirror of
https://github.com/golang/go
synced 2024-11-22 06:54:39 -07:00
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
This commit is contained in:
parent
e07958f7df
commit
8dbeb0ad07
@ -172,7 +172,7 @@ type test struct {
|
|||||||
donec chan bool // closed when done
|
donec chan bool // closed when done
|
||||||
|
|
||||||
src string
|
src string
|
||||||
action string // "compile", "build", "run", "errorcheck", "skip", "runoutput"
|
action string // "compile", "build", "run", "errorcheck", "skip", "runoutput", "compiledir"
|
||||||
|
|
||||||
tempDir string
|
tempDir string
|
||||||
err error
|
err error
|
||||||
@ -315,7 +315,7 @@ func (t *test) run() {
|
|||||||
}
|
}
|
||||||
for _, gofile := range files {
|
for _, gofile := range files {
|
||||||
afile := strings.Replace(gofile.Name(), ".go", "."+letter, -1)
|
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 {
|
if err != nil {
|
||||||
t.err = fmt.Errorf("%s\n%s", err, out)
|
t.err = fmt.Errorf("%s\n%s", err, out)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user