Testing on Android

I'm happy to report that after an illuminating meeting with the @testing-workgroup I was able to implement support for this in the skip android test front-end:

The whole process is pretty involved and useful only for Android development, so I'm skeptical about whether it makes sense to try to roll this into SwiftPM itself. But I have some vague half-baked ideas around how something like this might be included as part of a cross-compilation SDK itself, something like:

swift test --sdk aarch64-unknown-linux-android28 --sdk-testing-plugin-flags package-as-apk

How might this work? Would the cross-compilation SDK have a plugin-style shared library or command executable that swift test would delegate to at some point? Perhaps it would work like a macro, where the tooling would be built on-demand (to avoid needing to ship host-specific binaries with the Swift SDK)? I'll ponder this, along with other useful scenarios and applications like general emulator/container/external device support.

Update: I've added my thoughts to the related thread about this at Expand `swift test` to enable testing with cross-compilation target triples · Issue #9740 · swiftlang/swift-package-manager · GitHub

1 Like