Skip to content

Commit 42c51de

Browse files
author
Elias Naur
committed
misc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS
For #15919 Change-Id: I9fc38d9c8a9cc9406b551315e1599750fe212d0d Reviewed-on: https://go-review.googlesource.com/23635 Reviewed-by: David Crawshaw <[email protected]> Run-TryBot: Elias Naur <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent ba22172 commit 42c51de

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

misc/cgo/test/cthread.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package cgotest
88
import "C"
99

1010
import (
11+
"runtime"
1112
"sync"
1213
"testing"
1314
)
@@ -30,6 +31,9 @@ func Add(x int) {
3031
}
3132

3233
func testCthread(t *testing.T) {
34+
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
35+
t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
36+
}
3337
sum.i = 0
3438
C.doAdd(10, 6)
3539

misc/cgo/test/issue7978.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func test7978(t *testing.T) {
103103
if C.HAS_SYNC_FETCH_AND_ADD == 0 {
104104
t.Skip("clang required for __sync_fetch_and_add support on darwin/arm")
105105
}
106-
if runtime.GOOS == "android" {
106+
if runtime.GOOS == "android" || runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
107107
t.Skip("GOTRACEBACK is not passed on to the exec wrapper")
108108
}
109109
if os.Getenv("GOTRACEBACK") != "2" {

src/cmd/dist/test.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,7 @@ func (t *tester) registerTests() {
465465
})
466466
}
467467
}
468-
if t.cgoEnabled && !t.iOS() {
469-
// TODO(crawshaw): reenable on iOS
470-
// golang.org/issue/15919
471-
//
472-
// These tests are not designed to run off the host.
468+
if t.cgoEnabled {
473469
t.tests = append(t.tests, distTest{
474470
name: "cgo_test",
475471
heading: "../misc/cgo/test",
@@ -729,12 +725,6 @@ func (t *tester) runHostTest(dirBanner, pkg string) error {
729725
func (t *tester) cgoTest(dt *distTest) error {
730726
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
731727

732-
if t.iOS() {
733-
cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags())
734-
cmd.Env = env
735-
return cmd.Run()
736-
}
737-
738728
cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag(""))
739729
cmd.Env = env
740730

0 commit comments

Comments
 (0)