diff options
| author | Joel Sing <jsing@google.com> | 2015-09-27 02:33:00 +1000 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2015-09-27 01:04:59 +0000 |
| commit | c4689579c0bcd0ea028e3847e7d407141faa26e2 (patch) | |
| tree | 9ad61d610ea182d2eb0977bccaef0f048f5fdb6f /src | |
| parent | 59129c6a9356af5831b3f0a4bc581ba6abf26c8a (diff) | |
| download | go-c4689579c0bcd0ea028e3847e7d407141faa26e2.tar.xz | |
cmd/go: Skip note reading test with linkmode external on openbsd/arm
openbsd/arm does not support external linking - skip the note reading test that
uses linkmode external on this platform. While here, cleanup the code and
consistently use t.Skipf for all platforms that cannot run this test.
Change-Id: I64f0d9e038bc4c993c3d843fc069a0b723a924d6
Reviewed-on: https://go-review.googlesource.com/15054
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/note_test.go | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/cmd/go/note_test.go b/src/cmd/go/note_test.go index e2d78f3e76..1809f94cac 100644 --- a/src/cmd/go/note_test.go +++ b/src/cmd/go/note_test.go @@ -24,27 +24,23 @@ func TestNoteReading(t *testing.T) { t.Fatalf("buildID in hello binary = %q, want %q", id, buildID) } - if runtime.GOOS == "linux" && (runtime.GOARCH == "ppc64le" || runtime.GOARCH == "ppc64") { - t.Skipf("skipping - golang.org/issue/11184") - } - - if runtime.GOOS == "linux" && (runtime.GOARCH == "mips64le" || runtime.GOARCH == "mips64") { + switch { + case runtime.GOOS == "linux" && (runtime.GOARCH == "ppc64le" || runtime.GOARCH == "ppc64"): + t.Skipf("skipping - external linking not supported, golang.org/issue/11184") + case runtime.GOOS == "linux" && (runtime.GOARCH == "mips64le" || runtime.GOARCH == "mips64"): t.Skipf("skipping - external linking not supported, golang.org/issue/12560") + case runtime.GOOS == "openbsd" && runtime.GOARCH == "arm": + t.Skipf("skipping - external linking not supported, golang.org/issue/10619") + case runtime.GOOS == "plan9": + t.Skipf("skipping - external linking not supported") } - switch runtime.GOOS { - case "plan9": - // no external linking - t.Logf("no external linking - skipping linkmode=external test") - - default: - tg.run("build", "-ldflags", "-buildid="+buildID+" -linkmode=external", "-o", tg.path("hello.exe"), tg.path("hello.go")) - id, err := main.ReadBuildIDFromBinary(tg.path("hello.exe")) - if err != nil { - t.Fatalf("reading build ID from hello binary (linkmode=external): %v", err) - } - if id != buildID { - t.Fatalf("buildID in hello binary = %q, want %q (linkmode=external)", id, buildID) - } + tg.run("build", "-ldflags", "-buildid="+buildID+" -linkmode=external", "-o", tg.path("hello.exe"), tg.path("hello.go")) + id, err = main.ReadBuildIDFromBinary(tg.path("hello.exe")) + if err != nil { + t.Fatalf("reading build ID from hello binary (linkmode=external): %v", err) + } + if id != buildID { + t.Fatalf("buildID in hello binary = %q, want %q (linkmode=external)", id, buildID) } } |
