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:
parent
fd2f8d458e
commit
9c5e8c450a
43
src/cmd/dist/test.go
vendored
43
src/cmd/dist/test.go
vendored
@ -218,15 +218,10 @@ func (t *tester) registerTests() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
cgo := t.cgoEnabled
|
iOS := t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64")
|
||||||
if t.goos == "android" {
|
|
||||||
// Disable cgo tests on android.
|
|
||||||
// They are not designed to run off the host.
|
|
||||||
// golang.org/issue/8345
|
|
||||||
cgo = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if cgo {
|
if t.cgoEnabled && t.goos != "android" && !iOS {
|
||||||
|
// Disabled on android and iOS. golang.org/issue/8345
|
||||||
t.tests = append(t.tests, distTest{
|
t.tests = append(t.tests, distTest{
|
||||||
name: "cgo_stdio",
|
name: "cgo_stdio",
|
||||||
heading: "../misc/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()
|
"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{
|
t.tests = append(t.tests, distTest{
|
||||||
name: "cgo_test",
|
name: "cgo_test",
|
||||||
heading: "../misc/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")
|
t.registerTest("testgodefs", "../misc/cgo/testgodefs", "./test.bash")
|
||||||
}
|
}
|
||||||
if cgo {
|
if t.cgoEnabled {
|
||||||
if t.gohostos == "windows" {
|
if t.gohostos == "windows" {
|
||||||
t.tests = append(t.tests, distTest{
|
t.tests = append(t.tests, distTest{
|
||||||
name: "testso",
|
name: "testso",
|
||||||
heading: "../misc/cgo/testso",
|
heading: "../misc/cgo/testso",
|
||||||
fn: t.cgoTestSOWindows,
|
fn: t.cgoTestSOWindows,
|
||||||
})
|
})
|
||||||
} else if t.hasBash() {
|
} else if t.hasBash() && t.goos != "android" && !iOS {
|
||||||
t.registerTest("testso", "../misc/cgo/testso", "./test.bash")
|
t.registerTest("testso", "../misc/cgo/testso", "./test.bash")
|
||||||
}
|
}
|
||||||
if t.gohostos == "linux" && t.goarch == "amd64" {
|
if t.gohostos == "linux" && t.goarch == "amd64" {
|
||||||
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", "main.go")
|
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")
|
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")
|
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")
|
t.registerTest("wiki", "../doc/articles/wiki", "./test.bash")
|
||||||
}
|
|
||||||
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
|
|
||||||
t.registerTest("codewalk", "../doc/codewalk", "time", "./run")
|
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")
|
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")
|
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
|
// TODO(bradfitz): shard down into these tests, as
|
||||||
// this is one of the slowest (and most shardable)
|
// this is one of the slowest (and most shardable)
|
||||||
// tests.
|
// tests.
|
||||||
@ -304,7 +298,7 @@ func (t *tester) registerTests() {
|
|||||||
fn: t.testDirTest,
|
fn: t.testDirTest,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if t.goos != "nacl" && t.goos != "android" {
|
if t.goos != "nacl" && t.goos != "android" && !iOS {
|
||||||
t.tests = append(t.tests, distTest{
|
t.tests = append(t.tests, distTest{
|
||||||
name: "api",
|
name: "api",
|
||||||
heading: "API check",
|
heading: "API check",
|
||||||
@ -374,7 +368,8 @@ func (t *tester) extLink() bool {
|
|||||||
func (t *tester) cgoTest() error {
|
func (t *tester) cgoTest() error {
|
||||||
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
|
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 := t.dirCmd("misc/cgo/test", "go", "test")
|
||||||
cmd.Env = env
|
cmd.Env = env
|
||||||
return cmd.Run()
|
return cmd.Run()
|
||||||
|
Loading…
Reference in New Issue
Block a user