You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply toolset's testRunner property in swift test (#8254)
### Motivation:
Per [SE-0378 toolsets can specify an optional `testRunner` property](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md#toolsetjson-files), which so far had no effect. We should respect this property in `swift test` invocations when any toolsets or Swift SDKs are selected.
This property specifies a path to a test harness that has implementation-specific knowledge of interpreting produced test bundles.
This allows testing cross-compiled products in an environment other than the host, e.g. a container runtime when cross-compiled to Linux, qemu or a firmware flasher and serial port setup script with Swift Embedded for microcontrollers, or in a Wasm runtime for a WASI binary.
### Modifications:
Updated SwiftRunCommand to check for the debugger property in toolsets or Swift SDKs when such are specified. Its value is then used to launch a freshly built binary.
Changed test bundle extension from `.wasm` to `.xctest` used for other platforms to reduce special casing in corresponding code paths. Without this change, initial implementation crashed here in the `bundlePath`
property, triggering `fatalError`, as lookup logic always assumes `.xctest` extension: https://github.com/swiftlang/swift-package-manager/blob/6aa009fd30992c3cba9af3fcb439ef57b61b75da/Sources/SPMBuildCore/BuiltTestProduct.swift#L35
### Result:
Cross-compiled tests can be directly launched with a `swift test` invocation.
0 commit comments