Dearest Swift Testing adopters!
If you happened to download the 2024-08-19 main-branch toolchain, you might have noticed that Swift Testing is included! We're inching closer to adding Swift Testing into the Swift 6 toolchain, and I wanted to let you all know our plans for the Swift Testing package!
We’ll be creating our release/6.0
branch very shortly, in line with the other components of the Swift 6 release. Because Swift Testing will be in the Swift 6 toolchain soon, it won't be necessary for package authors to include it as a package dependency anymore.
So, shortly after the release of the Swift 6 toolchain, we will be creating a final pre-6.0 tag (0.99.0
) of the Swift Testing package that deprecates the @Test
and @Suite
attributes. If you’re including Swift Testing as a package dependency, you’ll see a warning like this one when you use @Test
or @Suite
:
ExampleTests.swift:30:4 'Test' is deprecated: Swift Testing is now included in the Swift 6 toolchain. Remove your 'swift-testing' package dependency to silence this warning.
Oh no!
Don't panic! We aren't deprecating the package as a whole. Our intent here is to notify developers that are still using these early/prerelease tags of Swift Testing that they don't need to do so anymore. These deprecations won't be present in the version of Swift Testing included with the toolchain, nor will it be present on future tags corresponding to future prerelease or release versions of the Swift toolchain.
If you wish to continue using Swift Testing 0.x
, you can modify your package manifest file to explicitly specify the tagged version you wish to use. Keep in mind that these early/prerelease tags of Swift Testing are not guaranteed to work with future Swift releases.
I still want to try out new features!
When we start working on the next version of Swift in earnest, you'll be able to get the latest version of Swift Testing by downloading a prerelease toolchain. If you want to try out new Swift Testing features on a release toolchain, you'll be able to add a package dependency such as:
.package(
url: "https://github.com/swiftlang/swift-testing.git",
from: "700.0.0-latest"
)
Where 700.0.0
would correspond to a hypothetical Swift 7 toolchain release[1]. Note that doing so opts you back into a prerelease version of Swift Syntax as well.
This versioning strategy matches the one used by Swift Syntax. ↩︎