Skip to content

Commit 9f83418

Browse files
committed
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 <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent ec94701 commit 9f83418

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cmd/link/link_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ func TestBuildForTvOS(t *testing.T) {
320320
}
321321

322322
link := exec.Command(CC[0], CC[1:]...)
323+
link.Args = append(link.Args, "-o", filepath.Join(tmpDir, "a.out")) // Avoid writing to package directory.
323324
link.Args = append(link.Args, ar, filepath.Join("testdata", "testBuildFortvOS", "main.m"))
324325
if out, err := link.CombinedOutput(); err != nil {
325326
t.Fatalf("%v: %v:\n%s", link.Args, err, out)

0 commit comments

Comments
 (0)