[6.2] preset: treat swift testing the same as xctest #81505
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Whenever XCtest is build and installed, do the same for swift-testing and swift-testing macros.
(cherry picked from commit 2962ea2)
Based on #81401
Explanation:
The SwiftPM repository added Swift Testing helpers in a non-test target, so we can re-used common helpers (e.g.: custom traits, custom tags, etc...). As part of the toolchain build, SwiftPM builds a baseline of itself using Cmake, then build the
Package.swift
using the Cmake artifact. During the "second" stage SwiftPM build, this non-test target (which is meant to only be used by tests), will be complied, and would cause a "Testing module not found error".The ideal solution would be to have a SwiftPM feature that would allow the specifying targets to only be made available for test target. Converting this target to a test targets causes
swift build
andswift test
to succeed, but Xcode package resolution fails.The path to least resistance was to treat Swift Testing, and Swift Testing Macros the same as XCTest in the build presets.
Scope:
This will likely cause longe build times since additional "projects" may be built.
Issues:
N/A
Original PRs:
#81401, to allow swiftlang/swift-package-manager#8495 and swiftlang/swift-package-manager#8663, and other changes to https://github.com/swiftlang/swift-package-manager Swift Testing tests.
Risk:
this is low risk as the change build extra "projects", but toolchain builds will likely fail if this is merged after the next SwiftPM
main
torelease/6.2
mergeTesting:
If we can get a toolchain successfully built, this would yield positive results. and prefer have this merged before the next SwiftPM
main
torelease/6.2
merge to avoid toolchain build failures.Reviewers:
@etcwilde