Skip to content

Commit 9c5e8c4

Browse files
committed
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 <[email protected]>
1 parent fd2f8d4 commit 9c5e8c4

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

src/cmd/dist/test.go

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,10 @@ func (t *tester) registerTests() {
218218
},
219219
})
220220

221-
cgo := t.cgoEnabled
222-
if t.goos == "android" {
223-
// Disable cgo tests on android.
224-
// They are not designed to run off the host.
225-
// golang.org/issue/8345
226-
cgo = false
227-
}
221+
iOS := t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64")
228222

229-
if cgo {
223+
if t.cgoEnabled && t.goos != "android" && !iOS {
224+
// Disabled on android and iOS. golang.org/issue/8345
230225
t.tests = append(t.tests, distTest{
231226
name: "cgo_stdio",
232227
heading: "../misc/cgo/stdio",
@@ -243,7 +238,12 @@ func (t *tester) registerTests() {
243238
"go", "run", filepath.Join(os.Getenv("GOROOT"), "test/run.go"), "-", ".").Run()
244239
},
245240
})
246-
241+
}
242+
if t.cgoEnabled && t.goos != "android" && !iOS {
243+
// TODO(crawshaw): reenable on android and iOS
244+
// golang.org/issue/8345
245+
//
246+
// These tests are not designed to run off the host.
247247
t.tests = append(t.tests, distTest{
248248
name: "cgo_test",
249249
heading: "../misc/cgo/test",
@@ -259,42 +259,36 @@ func (t *tester) registerTests() {
259259
})
260260
}
261261

262-
if t.hasBash() && cgo && t.goos != "darwin" {
262+
if t.hasBash() && t.cgoEnabled && t.goos != "darwin" {
263263
t.registerTest("testgodefs", "../misc/cgo/testgodefs", "./test.bash")
264264
}
265-
if cgo {
265+
if t.cgoEnabled {
266266
if t.gohostos == "windows" {
267267
t.tests = append(t.tests, distTest{
268268
name: "testso",
269269
heading: "../misc/cgo/testso",
270270
fn: t.cgoTestSOWindows,
271271
})
272-
} else if t.hasBash() {
272+
} else if t.hasBash() && t.goos != "android" && !iOS {
273273
t.registerTest("testso", "../misc/cgo/testso", "./test.bash")
274274
}
275275
if t.gohostos == "linux" && t.goarch == "amd64" {
276276
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", "main.go")
277277
}
278-
if t.hasBash() && t.gohostos != "windows" {
278+
if t.hasBash() && t.goos != "android" && !iOS && t.gohostos != "windows" {
279279
t.registerTest("cgo_errors", "../misc/cgo/errors", "./test.bash")
280280
}
281281
}
282-
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
282+
if t.hasBash() && t.goos != "nacl" && t.goos != "android" && !iOS {
283283
t.registerTest("doc_progs", "../doc/progs", "time", "./run")
284-
}
285-
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
286284
t.registerTest("wiki", "../doc/articles/wiki", "./test.bash")
287-
}
288-
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
289285
t.registerTest("codewalk", "../doc/codewalk", "time", "./run")
290-
}
291-
if t.hasBash() && t.goos != "nacl" && t.goos != "android" {
292286
t.registerTest("shootout", "../test/bench/shootout", "time", "./timing.sh", "-test")
293287
}
294-
if t.goos != "android" {
288+
if t.goos != "android" && !iOS {
295289
t.registerTest("bench_go1", "../test/bench/go1", "go", "test")
296290
}
297-
if t.goos != "android" {
291+
if t.goos != "android" && !iOS {
298292
// TODO(bradfitz): shard down into these tests, as
299293
// this is one of the slowest (and most shardable)
300294
// tests.
@@ -304,7 +298,7 @@ func (t *tester) registerTests() {
304298
fn: t.testDirTest,
305299
})
306300
}
307-
if t.goos != "nacl" && t.goos != "android" {
301+
if t.goos != "nacl" && t.goos != "android" && !iOS {
308302
t.tests = append(t.tests, distTest{
309303
name: "api",
310304
heading: "API check",
@@ -374,7 +368,8 @@ func (t *tester) extLink() bool {
374368
func (t *tester) cgoTest() error {
375369
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
376370

377-
if t.gohostos == "windows" {
371+
iOS := t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64")
372+
if t.gohostos == "windows" || t.goos == "android" || iOS {
378373
cmd := t.dirCmd("misc/cgo/test", "go", "test")
379374
cmd.Env = env
380375
return cmd.Run()

0 commit comments

Comments
 (0)