1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:54:44 -07:00

cmd/dist: update android testing TODO, add iOS

This CL updates a TODO on a condition excluding a lot of tests on
android, clarifying what needs to be done. Several of the tests should
be turned off, for example anything depending on the Go tool, others
should be enabled. (See #8345, comment 3 for more details.)

Also add iOS, which has the same set of restrictions.

Tested manually on linux/amd64, darwin/amd64, android/arm, darwin/arm.

Updates #8345

Change-Id: I147f0a915426e0e0de9a73f9aea353766156609b
Reviewed-on: https://go-review.googlesource.com/7734
Reviewed-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
David Crawshaw 2015-03-19 13:15:56 -04:00
parent fd2f8d458e
commit 9c5e8c450a

43
src/cmd/dist/test.go vendored
View File

@ -218,15 +218,10 @@ func (t *tester) registerTests() {
},
})
cgo := t.cgoEnabled
if t.goos == "android" {
// Disable cgo tests on android.
// They are not designed to run off the host.
// golang.org/issue/8345
cgo = false
}
iOS := t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64")
if cgo {
if t.cgoEnabled && t.goos != "android" && !iOS {
// Disabled on android and iOS. golang.org/issue/8345
t.tests = append(t.tests, distTest{
name: "cgo_stdio",
heading: "../misc/cgo/stdio",
@ -243,7 +238,12 @@ func (t *tester) registerTests() {
"go", "run", filepath.Join(os.Getenv("GOROOT"), "test/run.go"), "-", ".").Run()
},
})
}
if t.cgoEnabled && t.goos != "android" && !iOS {
// TODO(crawshaw): reenable on android and iOS
// golang.org/issue/8345
//
// These tests are not designed to run off the host.
t.tests = append(t.tests, distTest{
name: "cgo_test",
heading: "../misc/cgo/test",
@ -259,42 +259,36 @@ func (t *tester) registerTests() {
})
}
if t.hasBash() && cgo && t.goos != "darwin" {
if t.hasBash() && t.cgoEnabled && t.goos != "darwin" {
t.registerTest("testgodefs", "../misc/cgo/testgodefs", "./test.bash")
}
if cgo {
if t.cgoEnabled {
if t.gohostos == "windows" {
t.tests = append(t.tests, distTest{
name: "testso",
heading: "../misc/cgo/testso",
fn: t.cgoTestSOWindows,
})
} else if t.hasBash() {
} else if t.hasBash() && t.goos != "android" && !iOS {
t.registerTest("testso", "../misc/cgo/testso", "./test.bash")
}
if t.gohostos == "linux" && t.goarch == "amd64" {
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", "main.go")
}
if t.hasBash() && t.gohostos != "windows" {
if t.hasBash() && t.goos != "android" && !iOS && t.gohostos != "windows" {
t.registerTest("cgo_errors", "../misc/cgo/errors", "./test.bash")
}
}
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
if t.hasBash() && t.goos != "nacl" && t.goos != "android" && !iOS {
t.registerTest("doc_progs", "../doc/progs", "time", "./run")
}
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
t.registerTest("wiki", "../doc/articles/wiki", "./test.bash")
}
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
t.registerTest("codewalk", "../doc/codewalk", "time", "./run")
}
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
t.registerTest("shootout", "../test/bench/shootout", "time", "./timing.sh", "-test")
}
if t.goos != "android" {
if t.goos != "android" && !iOS {
t.registerTest("bench_go1", "../test/bench/go1", "go", "test")
}
if t.goos != "android" {
if t.goos != "android" && !iOS {
// TODO(bradfitz): shard down into these tests, as
// this is one of the slowest (and most shardable)
// tests.
@ -304,7 +298,7 @@ func (t *tester) registerTests() {
fn: t.testDirTest,
})
}
if t.goos != "nacl" && t.goos != "android" {
if t.goos != "nacl" && t.goos != "android" && !iOS {
t.tests = append(t.tests, distTest{
name: "api",
heading: "API check",
@ -374,7 +368,8 @@ func (t *tester) extLink() bool {
func (t *tester) cgoTest() error {
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
if t.gohostos == "windows" {
iOS := t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64")
if t.gohostos == "windows" || t.goos == "android" || iOS {
cmd := t.dirCmd("misc/cgo/test", "go", "test")
cmd.Env = env
return cmd.Run()