mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
cmd/go: fix TestNoCache on Plan 9
CL 91097 added TestNoCache. However, this test is failing on Plan 9 because the HOME environment variable doesn't contain the home directory where the Go cache is located. This change fixes the TestNoCache test by using the home environment variable instead of HOME on Plan 9. Fixes #23644. Change-Id: Icfb7a7a4c2852f159c93032b4081411628a2787f Reviewed-on: https://go-review.googlesource.com/91216 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
e5186895fc
commit
6f37fee354
|
@ -5387,7 +5387,11 @@ func TestNoCache(t *testing.T) {
|
||||||
tg.parallel()
|
tg.parallel()
|
||||||
tg.tempFile("triv.go", `package main; func main() {}`)
|
tg.tempFile("triv.go", `package main; func main() {}`)
|
||||||
tg.must(os.MkdirAll(tg.path("unwritable"), 0555))
|
tg.must(os.MkdirAll(tg.path("unwritable"), 0555))
|
||||||
tg.setenv("HOME", tg.path(filepath.Join("unwritable", "home")))
|
home := "HOME"
|
||||||
|
if runtime.GOOS == "plan9" {
|
||||||
|
home = "home"
|
||||||
|
}
|
||||||
|
tg.setenv(home, tg.path(filepath.Join("unwritable", "home")))
|
||||||
tg.unsetenv("GOCACHE")
|
tg.unsetenv("GOCACHE")
|
||||||
tg.run("build", "-o", tg.path("triv"), tg.path("triv.go"))
|
tg.run("build", "-o", tg.path("triv"), tg.path("triv.go"))
|
||||||
tg.grepStderr("disabling cache", "did not disable cache")
|
tg.grepStderr("disabling cache", "did not disable cache")
|
||||||
|
|
Loading…
Reference in a new issue