finagolfin / swift-android-sdk

Android SDKs for Swift
Apache License 2.0
138 stars 14 forks source link

Add support for Testing module #174

Open marcprux opened 6 days ago

marcprux commented 6 days ago

Macros work with the latest swift 6 Android toolchain on a macOS host (🎉), but Testing is not included in the built SDK, resulting in errors when building a newly created skip package init project:

[2/12] Emitting module swift6_test_demoTests
/Users/marc/Desktop/swift6-test-demo/Tests/swift6-test-demoTests/swift6_test_demoTests.swift:1:8: error: no such module 'Testing'
1 | import Testing
  |        `- error: no such module 'Testing'
2 | @testable import swift6_test_demo
3 | 
[3/12] Compiling swift6_test_demoTests swift6_test_demoTests.swift
/Users/marc/Desktop/swift6-test-demo/Tests/swift6-test-demoTests/swift6_test_demoTests.swift:1:8: error: no such module 'Testing'
1 | import Testing
  |        `- error: no such module 'Testing'
2 | @testable import swift6_test_demo
3 | 

I had added --swift-testing --install-swift-testing to the build-script in #167 and added swift-testing to get-packages-and-swift-source.swift, hoping that would be enough to build and include the module, but that doesn't seem sufficient.

Is there some additional step that is needed to get the Testing.swiftmodule built and included?

finagolfin commented 6 days ago

No idea, I have never tried that new testing framework with Android and only tried it once or twice on linux. Given that cross-compiling packages with macros was broken, I figured there was no point since it wouldn't work and they only finally added it to the toolchain last month, swiftlang/swift#75515.

My guess would be that their build script requires some work on installation, if it built fine on the CI. Feel free to look into it if you want to use it, I've got other more important stuff to deal with.