aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-10-17 15:10:59 -0400
committerRuss Cox <rsc@golang.org>2017-10-20 12:39:59 -0400
commitf5fe0e35423125202986f3572b5b3405ce7ea904 (patch)
tree9935f667a1485f29b53f42a7fdb0e7cd6d588997
parent179d09dd07d1faed24d842e84833cf207943ecda (diff)
downloadgo-f5fe0e35423125202986f3572b5b3405ce7ea904.tar.gz
go-f5fe0e35423125202986f3572b5b3405ce7ea904.zip
[release-branch.go1.8] cmd/go: clean up x.exe properly in TestImportMain
More generally I'm concerned about these tests using $GOROOT/src/cmd/go as scratch space, especially combined wtih tg.parallel() - it's easy to believe some other test might inadvertently also try to write x.exe about the same time. This CL only solves the "didn't clean up x.exe" problem and leaves for another day the "probably shouldn't write to cmd/go at all" problem. Fixes #22266. Change-Id: I651534d70e2d360138e0373fb4a316081872550b Reviewed-on: https://go-review.googlesource.com/71410 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/cmd/go/go_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index 79734f90ed..a6eaef6293 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -2737,7 +2737,7 @@ func TestImportMain(t *testing.T) {
func TestFoo(t *testing.T) {}
`)
tg.setenv("GOPATH", tg.path("."))
- tg.creatingTemp("x")
+ tg.creatingTemp("x" + exeSuffix)
tg.run("build", "x")
tg.run("test", "x")