Skip to content

[6.1] Apply toolset's testRunner property in swift-test #8258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 4, 2025

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jan 29, 2025

Cherry-pick of #8254 merged as b14e431.

Explanation: Per SE-0378 toolsets can specify an optional testRunner property, which so far had no effect. We should respect this property in swift test invocations when any toolsets or Swift SDKs are selected.

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 Wasm binary.
Scope: Only impacts swift-test when a toolset or a Swift SDK are selected.
Risk: Low, due to limited scope and automated testing.
Testing: Added a new test cause to the existing XCTest suite.
Issue: rdar://143815066
Reviewer: @dschaefer2

# Conflicts:
#	Tests/CommandsTests/TestCommandTests.swift
@MaxDesiatov MaxDesiatov added swift test Changes impacting `swift test` tool swift 6.1 Related to Swift 6.1 release branch labels Jan 29, 2025
@MaxDesiatov MaxDesiatov changed the title Fix testToolsetRunner on macOS [6.1] Apply toolset's testRunner property in swift-test Jan 29, 2025
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 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.

(cherry picked from commit 411cb43)

# Conflicts:
#	Fixtures/Miscellaneous/EchoExecutable/toolset.json
#	Tests/CommandsTests/TestCommandTests.swift
(cherry picked from commit 3ce1bbf)

# Conflicts:
#	Fixtures/Miscellaneous/EchoExecutable/echo.sh
#	Tests/CommandsTests/RunCommandTests.swift
#	Tests/CommandsTests/TestCommandTests.swift
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 8fc6467 into release/6.1 Feb 4, 2025
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/toolset-test-runner-6.1 branch February 4, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-compilation swift test Changes impacting `swift test` tool swift 6.1 Related to Swift 6.1 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants