Tests: Convert Swift tests to use Testing module where possible #1202
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.
Add the upcoming standard swift-testing library as a dependency.
In theory, this library will be included in the swift toolchain. Until that plan is finalized and stabilized for both Linux and macOS, pull it from GitHub using FetchContent.
The Testing.framework shipped with Xcode 16 Beta 5 links against libraries in /usr/lib/swift that only exist in the Developer/ and toolchain sections of the Xcode app, and not on my macOS installation. It also doesn't seem to be added to the rpath of our applications, as it lives in the Xcode Developer directories instead of in the system path. As such, we'll keep building it for macOS from source until the swift-testing maintainers come up with a good way to use the library from CMake, as the current focus is the Swift Package Manager.
The Xcode-shipped Testing.framework can be used if the developer sets USE_XCODE_TESTING_LIBRARY to ON in FindSwiftTesting.cmake and calls our test module like so: