@@ -218,15 +218,10 @@ func (t *tester) registerTests() {
218
218
},
219
219
})
220
220
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" )
228
222
229
- if cgo {
223
+ if t .cgoEnabled && t .goos != "android" && ! iOS {
224
+ // Disabled on android and iOS. golang.org/issue/8345
230
225
t .tests = append (t .tests , distTest {
231
226
name : "cgo_stdio" ,
232
227
heading : "../misc/cgo/stdio" ,
@@ -243,7 +238,12 @@ func (t *tester) registerTests() {
243
238
"go" , "run" , filepath .Join (os .Getenv ("GOROOT" ), "test/run.go" ), "-" , "." ).Run ()
244
239
},
245
240
})
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.
247
247
t .tests = append (t .tests , distTest {
248
248
name : "cgo_test" ,
249
249
heading : "../misc/cgo/test" ,
@@ -259,42 +259,36 @@ func (t *tester) registerTests() {
259
259
})
260
260
}
261
261
262
- if t .hasBash () && cgo && t .goos != "darwin" {
262
+ if t .hasBash () && t . cgoEnabled && t .goos != "darwin" {
263
263
t .registerTest ("testgodefs" , "../misc/cgo/testgodefs" , "./test.bash" )
264
264
}
265
- if cgo {
265
+ if t . cgoEnabled {
266
266
if t .gohostos == "windows" {
267
267
t .tests = append (t .tests , distTest {
268
268
name : "testso" ,
269
269
heading : "../misc/cgo/testso" ,
270
270
fn : t .cgoTestSOWindows ,
271
271
})
272
- } else if t .hasBash () {
272
+ } else if t .hasBash () && t . goos != "android" && ! iOS {
273
273
t .registerTest ("testso" , "../misc/cgo/testso" , "./test.bash" )
274
274
}
275
275
if t .gohostos == "linux" && t .goarch == "amd64" {
276
276
t .registerTest ("testasan" , "../misc/cgo/testasan" , "go" , "run" , "main.go" )
277
277
}
278
- if t .hasBash () && t .gohostos != "windows" {
278
+ if t .hasBash () && t .goos != "android" && ! iOS && t . gohostos != "windows" {
279
279
t .registerTest ("cgo_errors" , "../misc/cgo/errors" , "./test.bash" )
280
280
}
281
281
}
282
- if t .hasBash () && t .goos != "nacl" && t .goos != "android" {
282
+ if t .hasBash () && t .goos != "nacl" && t .goos != "android" && ! iOS {
283
283
t .registerTest ("doc_progs" , "../doc/progs" , "time" , "./run" )
284
- }
285
- if t .hasBash () && t .goos != "nacl" && t .goos != "android" {
286
284
t .registerTest ("wiki" , "../doc/articles/wiki" , "./test.bash" )
287
- }
288
- if t .hasBash () && t .goos != "nacl" && t .goos != "android" {
289
285
t .registerTest ("codewalk" , "../doc/codewalk" , "time" , "./run" )
290
- }
291
- if t .hasBash () && t .goos != "nacl" && t .goos != "android" {
292
286
t .registerTest ("shootout" , "../test/bench/shootout" , "time" , "./timing.sh" , "-test" )
293
287
}
294
- if t .goos != "android" {
288
+ if t .goos != "android" && ! iOS {
295
289
t .registerTest ("bench_go1" , "../test/bench/go1" , "go" , "test" )
296
290
}
297
- if t .goos != "android" {
291
+ if t .goos != "android" && ! iOS {
298
292
// TODO(bradfitz): shard down into these tests, as
299
293
// this is one of the slowest (and most shardable)
300
294
// tests.
@@ -304,7 +298,7 @@ func (t *tester) registerTests() {
304
298
fn : t .testDirTest ,
305
299
})
306
300
}
307
- if t .goos != "nacl" && t .goos != "android" {
301
+ if t .goos != "nacl" && t .goos != "android" && ! iOS {
308
302
t .tests = append (t .tests , distTest {
309
303
name : "api" ,
310
304
heading : "API check" ,
@@ -374,7 +368,8 @@ func (t *tester) extLink() bool {
374
368
func (t * tester ) cgoTest () error {
375
369
env := mergeEnvLists ([]string {"GOTRACEBACK=2" }, os .Environ ())
376
370
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 {
378
373
cmd := t .dirCmd ("misc/cgo/test" , "go" , "test" )
379
374
cmd .Env = env
380
375
return cmd .Run ()
0 commit comments