]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: skip TestDWARFiOS if the iOS tools aren't installed
authorJeremy Faller <jeremy@golang.org>
Tue, 19 May 2020 14:53:41 +0000 (10:53 -0400)
committerJeremy Faller <jeremy@golang.org>
Tue, 19 May 2020 16:58:43 +0000 (16:58 +0000)
Change-Id: I5bccb5935cdeb3a0ccf398a57eb4776f0e6aedca
Reviewed-on: https://go-review.googlesource.com/c/go/+/234578
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/dwarf_test.go

index 5926f09e4a5da5bfe3b7dd2d237238097b96dd0d..326f493e2dd6254ce435fb1894c4cf607865e662 100644 (file)
@@ -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")