Is Swift Testing appropriate for use in non-concurrent environments?
Generated on 8/12/2024
1 search
Swift Testing is designed to work effectively in concurrent environments, leveraging Swift's concurrency features such as async/await and actor isolation. However, it can also be used in non-concurrent environments. While parallel testing is enabled by default to maximize performance, you can run tests serially if needed. This is achieved by using the serialized trait, which ensures that tests run one at a time. Although running tests serially may lose some performance benefits, it is possible and appropriate for non-concurrent environments.
For more details on running tests serially, you can refer to the session Go further with Swift Testing (23:16).
Migrate your app to Swift 6
Experience Swift 6 migration in action as we update an existing sample app. Learn how to migrate incrementally, module by module, and how the compiler helps you identify code that’s at risk of data races. Discover different techniques for ensuring clear isolation boundaries and eliminating concurrent access to shared mutable state.
Go further with Swift Testing
Learn how to write a sweet set of (test) suites using Swift Testing’s baked-in features. Discover how to take the building blocks further and use them to help expand tests to cover more scenarios, organize your tests across different suites, and optimize your tests to run in parallel.
Meet Swift Testing
Introducing Swift Testing: a new package for testing your code using Swift. Explore the building blocks of its powerful new API, discover how it can be applied in common testing workflows, and learn how it relates to XCTest and open source Swift.
What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.