mirror of
https://github.com/golang/go
synced 2024-09-18 15:32:18 +00:00
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 <crawshaw@golang.org> Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
ba22172832
commit
42c51debe8
|
@ -8,6 +8,7 @@ package cgotest
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -30,6 +31,9 @@ func Add(x int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testCthread(t *testing.T) {
|
func testCthread(t *testing.T) {
|
||||||
|
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
||||||
|
t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
|
||||||
|
}
|
||||||
sum.i = 0
|
sum.i = 0
|
||||||
C.doAdd(10, 6)
|
C.doAdd(10, 6)
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ func test7978(t *testing.T) {
|
||||||
if C.HAS_SYNC_FETCH_AND_ADD == 0 {
|
if C.HAS_SYNC_FETCH_AND_ADD == 0 {
|
||||||
t.Skip("clang required for __sync_fetch_and_add support on darwin/arm")
|
t.Skip("clang required for __sync_fetch_and_add support on darwin/arm")
|
||||||
}
|
}
|
||||||
if runtime.GOOS == "android" {
|
if runtime.GOOS == "android" || runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
||||||
t.Skip("GOTRACEBACK is not passed on to the exec wrapper")
|
t.Skip("GOTRACEBACK is not passed on to the exec wrapper")
|
||||||
}
|
}
|
||||||
if os.Getenv("GOTRACEBACK") != "2" {
|
if os.Getenv("GOTRACEBACK") != "2" {
|
||||||
|
|
12
src/cmd/dist/test.go
vendored
12
src/cmd/dist/test.go
vendored
|
@ -465,11 +465,7 @@ func (t *tester) registerTests() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if t.cgoEnabled && !t.iOS() {
|
if t.cgoEnabled {
|
||||||
// TODO(crawshaw): reenable on iOS
|
|
||||||
// golang.org/issue/15919
|
|
||||||
//
|
|
||||||
// These tests are not designed to run off the host.
|
|
||||||
t.tests = append(t.tests, distTest{
|
t.tests = append(t.tests, distTest{
|
||||||
name: "cgo_test",
|
name: "cgo_test",
|
||||||
heading: "../misc/cgo/test",
|
heading: "../misc/cgo/test",
|
||||||
|
@ -729,12 +725,6 @@ func (t *tester) runHostTest(dirBanner, pkg string) error {
|
||||||
func (t *tester) cgoTest(dt *distTest) error {
|
func (t *tester) cgoTest(dt *distTest) error {
|
||||||
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
|
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
|
||||||
|
|
||||||
if t.iOS() {
|
|
||||||
cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags())
|
|
||||||
cmd.Env = env
|
|
||||||
return cmd.Run()
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag(""))
|
cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto", t.runFlag(""))
|
||||||
cmd.Env = env
|
cmd.Env = env
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue