-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Build one test product for both Swift Testing and XCTest (with Swift Testing enabled by default.) #7789
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
Build one test product for both Swift Testing and XCTest (with Swift Testing enabled by default.) #7789
Conversation
@swift-ci please test |
@swift-ci please test |
58abe35
to
19a986d
Compare
@swift-ci please test |
@swift-ci please test Windows |
…Testing enabled by default.) This PR refactors the previously-experimental Swift Testing support logic so that only a single build product is produced when using both XCTest and Swift Testing, and detection of Swift Testing usage is no longer needed at compile time. On macOS, Xcode 16 is responsible for hosting Swift Testing content, so additional changes may be needed in Xcode to support this refactoring. Such changes are beyond the purview of the Swift open source project. This PR includes changes from the previous PRs numbered #7766, #7783, and #7787. Resolves rdar://120864035. --------- Co-authored-by: Pavel Yaskevich <xedin@apache.org>
19a986d
to
b667027
Compare
@swift-ci please test |
@swift-ci please test Windows |
@@ -177,7 +171,7 @@ enum TestingSupport { | |||
// execution but is required when the tests are running in parallel as | |||
// SwiftPM repeatedly invokes the test binary with the test case name as | |||
// the filter. | |||
let codecovProfile = buildParameters.buildPath.appending(components: "codecov", "default%m.profraw") | |||
let codecovProfile = buildParameters.buildPath.appending(components: "codecov", "\(library)%m.profraw") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this use buildParameters.codeCovPath
as the base?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably. This bit's not new though and I'd be tempting fate changing it in this PR. We can look at a change separately.
…Testing enabled by default.) (#7789) This PR refactors the previously-experimental Swift Testing support logic so that only a single build product is produced when using both XCTest and Swift Testing, and detection of Swift Testing usage is no longer needed at compile time. On macOS, Xcode 16 is responsible for hosting Swift Testing content, so additional changes may be needed in Xcode to support this refactoring. Such changes are beyond the purview of the Swift open source project. This PR includes changes from the previous PRs numbered #7766, #7783, Resolves rdar://120864035. Co-authored-by: Pavel Yaskevich <xedin@apache.org>
…Swift Testing enabled by default.) (#7794) **Explanation:** Refactors the previously-experimental Swift Testing support logic so that only a single build product is produced when using both XCTest and Swift Testing, and detection of Swift Testing usage is no longer needed at compile time. **Scope:** Implementation of Swift Testing/SwiftPM integration; touches mostly `swift test` but affects `swift build` and `swift package init` as well. **Issue:** rdar://120864035 **Original PR:** #7777, #7789, #7796 **Risk:** Moderate—refactors how we build and run tests. **Testing:** Existing test coverage in the package as well as test coverage in the Swift Testing package; additional integration testing will be added once Swift Testing is in the toolchain. **Reviewer:** @bnbarham @xedin @briancroom @dennisweissmann --------- Co-authored-by: Pavel Yaskevich <xedin@apache.org>
`SWIFT_PM_TEST_LIBRARY` was renamed to `SWIFT_TESTING_ENABLED` in swiftlang#7789, but we forgot to update the test because `XCTAssertAsyncNoThrow` always succeeded and we didn't notice the failure.
`SWIFT_PM_TEST_LIBRARY` was renamed to `SWIFT_TESTING_ENABLED` in swiftlang#7789, but we forgot to update the test because `XCTAssertAsyncNoThrow` always succeeded and we didn't notice the failure.
This PR refactors the previously-experimental Swift Testing support logic so that only a single build product is produced when using both XCTest and Swift Testing, and detection of Swift Testing usage is no longer needed at compile time.
On macOS, Xcode 16 is responsible for hosting Swift Testing content, so additional changes may be needed in Xcode to support this refactoring. Such changes are beyond the purview of the Swift open source project.
This PR includes changes from the previous PRs numbered #7766, #7783, #7784, and #7787.
Resolves rdar://120864035.