From: Jeremy Faller Date: Tue, 19 May 2020 14:53:41 +0000 (-0400) Subject: [dev.link] cmd/link: skip TestDWARFiOS if the iOS tools aren't installed X-Git-Tag: go1.16beta1~1378^2~117 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7214090180276603bbfdacaf736058f49b8c3041;p=gostls13.git [dev.link] cmd/link: skip TestDWARFiOS if the iOS tools aren't installed Change-Id: I5bccb5935cdeb3a0ccf398a57eb4776f0e6aedca Reviewed-on: https://go-review.googlesource.com/c/go/+/234578 Run-TryBot: Jeremy Faller Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/link/dwarf_test.go b/src/cmd/link/dwarf_test.go index 5926f09e4a..326f493e2d 100644 --- a/src/cmd/link/dwarf_test.go +++ b/src/cmd/link/dwarf_test.go @@ -191,6 +191,13 @@ func TestDWARFiOS(t *testing.T) { if err := exec.Command("xcrun", "--help").Run(); err != nil { t.Skipf("error running xcrun, required for iOS cross build: %v", err) } + // Check to see if the ios tools are installed. It's possible to have the command line tools + // installed without the iOS sdk. + if output, err := exec.Command("xcodebuild -showsdks").CombinedOutput(); err != nil { + t.Skipf("error running xcodebuild, required for iOS cross build: %v", err) + } else if !strings.Contains(string(output), "iOS SDK") { + t.Skipf("iOS SDK not detected.") + } cc := "CC=" + runtime.GOROOT() + "/misc/ios/clangwrap.sh" // iOS doesn't allow unmapped segments, so iOS executables don't have DWARF. testDWARF(t, "", false, cc, "CGO_ENABLED=1", "GOOS=darwin", "GOARCH=arm64")