From: Alex Brainman Date: Sat, 4 Feb 2017 06:33:14 +0000 (+1100) Subject: cmd/nm: skip TestInternalLinkerCgoFile if no internal linking is supported X-Git-Tag: go1.9beta1~1736 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=769be04feb724e03c1f2b757fc19326a1486896c;p=gostls13.git cmd/nm: skip TestInternalLinkerCgoFile if no internal linking is supported Fixes build. Change-Id: I2fee624c8a4b228bb9f2889e241ea016a317bb11 Reviewed-on: https://go-review.googlesource.com/36373 TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman --- diff --git a/src/cmd/nm/nm_cgo_test.go b/src/cmd/nm/nm_cgo_test.go index 633f9c0406..de16f77ecc 100644 --- a/src/cmd/nm/nm_cgo_test.go +++ b/src/cmd/nm/nm_cgo_test.go @@ -7,13 +7,30 @@ package main import ( + "runtime" "testing" ) func TestInternalLinkerCgoFile(t *testing.T) { + if !canInternalLink() { + t.Skip("skipping; internal linking is not supported") + } testGoFile(t, true, false) } +func canInternalLink() bool { + switch runtime.GOOS { + case "dragonfly": + return false + case "linux": + switch runtime.GOARCH { + case "arm64", "mips64", "mips64le", "mips", "mipsle": + return false + } + } + return true +} + func TestExternalLinkerCgoFile(t *testing.T) { testGoFile(t, true, true) }