From: Dmitri Shuralyov Date: Fri, 15 Jan 2021 18:19:31 +0000 (-0500) Subject: cmd/link: remove GOROOT write in TestBuildForTvOS X-Git-Tag: go1.16rc1~70 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9f83418b83;p=gostls13.git cmd/link: remove GOROOT write in TestBuildForTvOS Tests should avoid writing to GOROOT when possible. Such writes would fail if GOROOT is non-writeable, and it can interfere with other tests that don't expect GOROOT to change during test execution. Updates #28387. Change-Id: I7d72614f218df3375540f5c2f9c9f8c11034f602 Reviewed-on: https://go-review.googlesource.com/c/go/+/284293 Trust: Dmitri Shuralyov Reviewed-by: Cherry Zhang Reviewed-by: Bryan C. Mills --- diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 7eeb7ef568..8153c0b31b 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -320,6 +320,7 @@ func TestBuildForTvOS(t *testing.T) { } link := exec.Command(CC[0], CC[1:]...) + link.Args = append(link.Args, "-o", filepath.Join(tmpDir, "a.out")) // Avoid writing to package directory. link.Args = append(link.Args, ar, filepath.Join("testdata", "testBuildFortvOS", "main.m")) if out, err := link.CombinedOutput(); err != nil { t.Fatalf("%v: %v:\n%s", link.Args, err, out)