I have downloaded the current latest snapshot for Xcode. I have then selected Swift 6.1 Development Snapshot 2025-02-10 (a) in Xcode -> Toolchains. Compilation fails due to:
Cannot find type 'TestScoping' in scope
Compiling/running is successful though with this terminal command:
xcrun -toolchain org.swift.610202502101a swift test
Is there anything else that needs to be done to test development snapshots within Xcode? (Is this just a bug and I should file a radar?)
Hi @noremac, I'm happy to hear you're interested in trying Test Scoping Traits in a development snapshot toolchain!
I was able to reproduce the issue you're describing when attempting to use Xcode for this workflow. I consider that a bug, so please do file a Feedback with Apple about that.
For now, I would encourage you to use the swift test CLI tool as a workaround since that's the easiest and best-supported mechanism currently. It is technically possible, with enough effort, to manually add compiler flags and runtime environment variables such that Xcode will use the copy of Swift Testing included in a development snapshot toolchain, but the steps are quite onerous and easy to get wrong, so I don't necessarily recommend trying to do that. I can try to provide guidance if you have a strong desire to get that working, but otherwise I'd recommend sticking with swift test. Hope that helps!
Thanks for filing the Feedback, @noremac! There are several changes needed to begin supporting this, including some within Xcode itself. But one of the changes is underway in the swift-build project which recently became open source. If you're curious you can follow along with the PR below:
Also, in the days since your original post, Xcode 16.3 Beta has been posted and it includes the new TestScoping APIs, so another way you can try them out is by using that beta version of Xcode.