From dee3e3aebd1c26de237f44138406c51c6a162058 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 22 Apr 2020 23:25:41 -0400 Subject: [PATCH] [dev.link] cmd/link: clean up some tests Use a separate directory for TestBuildFortvOS test files. Remove a bad comment in TestTrampoline. Change-Id: I2dc07ae575ec3f73fb7cea26743094b11a41b464 Reviewed-on: https://go-review.googlesource.com/c/go/+/229619 Run-TryBot: Cherry Zhang Reviewed-by: Than McIntosh Reviewed-by: Jeremy Faller --- src/cmd/link/link_test.go | 5 ++--- src/cmd/link/testdata/{ => testBuildFortvOS}/lib.go | 0 src/cmd/link/testdata/{ => testBuildFortvOS}/main.m | 0 3 files changed, 2 insertions(+), 3 deletions(-) rename src/cmd/link/testdata/{ => testBuildFortvOS}/lib.go (100%) rename src/cmd/link/testdata/{ => testBuildFortvOS}/main.m (100%) diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index f374e9322fd..bf097532de6 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -287,7 +287,7 @@ func TestBuildForTvOS(t *testing.T) { "-fembed-bitcode", "-framework", "CoreFoundation", } - lib := filepath.Join("testdata", "lib.go") + lib := filepath.Join("testdata", "testBuildFortvOS", "lib.go") tmpDir, err := ioutil.TempDir("", "go-link-TestBuildFortvOS") if err != nil { t.Fatal(err) @@ -308,7 +308,7 @@ func TestBuildForTvOS(t *testing.T) { } link := exec.Command(CC[0], CC[1:]...) - link.Args = append(link.Args, ar, filepath.Join("testdata", "main.m")) + 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) } @@ -661,7 +661,6 @@ func TestTrampoline(t *testing.T) { } exe := filepath.Join(tmpdir, "hello.exe") - // Build and run with old object file format. cmd := exec.Command(testenv.GoToolPath(t), "build", "-ldflags=-debugtramp=2", "-o", exe, src) out, err := cmd.CombinedOutput() if err != nil { diff --git a/src/cmd/link/testdata/lib.go b/src/cmd/link/testdata/testBuildFortvOS/lib.go similarity index 100% rename from src/cmd/link/testdata/lib.go rename to src/cmd/link/testdata/testBuildFortvOS/lib.go diff --git a/src/cmd/link/testdata/main.m b/src/cmd/link/testdata/testBuildFortvOS/main.m similarity index 100% rename from src/cmd/link/testdata/main.m rename to src/cmd/link/testdata/testBuildFortvOS/main.m