swiftlang/swift-testing
54.7
Adequate · 1 October 2026
38.4k
lines of production code
Swift
primary language
2
measurements over time
What this system is
This system is the Swift Testing library, a framework for writing and executing tests in Swift applications. It provides core capabilities for defining test suites, running assertions, and handling parameterized or exit tests, while supporting a wide range of platforms including macOS, Linux, Windows, and embedded environments. The library features a robust attachment system for recording diagnostic data like images and structured data, and exposes a stable JSON-based ABI for integration with external tooling and package managers.
How it got here
2023 — Open-source release and CMake build support
28 changes.
This period focused on the initial open-source release of Swift Testing, establishing CMake as the primary build system alongside Swift Package Manager support. The work involved a comprehensive overhaul of the library's core APIs, including expanded macro support, enhanced diagnostics, and new traits for test control and attachment handling. Internal infrastructure was refactored for better concurrency safety, cross-platform compatibility, and static linking, while extensive documentation and test coverage were added to support the new public interface.
2024–2025 — CMake migration and attachment system
27 changes.
The project transitioned its build infrastructure to CMake and established a stable ABI for external tool integration. A major feature addition was the attachment system, enabling the serialization of diagnostic data and native image types across multiple platforms and frameworks.
2026 — Embedded Swift and Testing Infrastructure
4 changes.
This period focused on expanding Swift Testing capabilities for embedded environments by adding WASI and POSIX platform abstraction layers. It also introduced a new CLI harness tool and a showcase application to validate testing features like argument handling and attachment recording on constrained targets.
Features
Add CoreGraphics cross-import overlay for attaching CGImage attachments
A new \\_Testing\_CoreGraphics\ cross-import overlay is introduced for Apple platforms, enabling tests to attach \CGImage\ instances directly. This module re-exports the \Testing\ module and includes specific support files for handling \CGImage\ attachments, image format UT types, and attachable wrappers, allowing users to leverage CoreGraphics image types in test attachments without manual conversion.
_Sources/Overlays/\_Testing\CoreGraphics · high confidence
Add Embedded Swift showcase application and tests
Introduces a new Embedded Swift showcase application that validates the Swift Testing framework on embedded targets. The entry point (Main.c) now supports capturing argc, argv, and environment variables, routing execution to the embedded main handler. A corresponding test suite (Tests.swift) is included to verify core testing capabilities, including basic assertions, argument iteration, error handling, issue recording, and attachment recording within the embedded environment.
Sources/EmbeddedShowcase · high confidence
Add Embedded Swift support for WASI and POSIX platform abstraction layers
The EmbeddedPlatform module now includes dedicated implementation files for WASI and POSIX targets when the Embedded Swift feature is enabled. For WASI, the platform layer captures command-line arguments (\argc\/\argv\) and environment variables using WASI system calls, while providing basic stubs for target info and console capabilities. For POSIX targets, it captures \argc\/\argv\ via GNU C library constructor functions, retrieves the environment, and determines console capabilities. Additionally, a shared WASI-specific implementation handles console output and JSON writing, supporting writes to standard streams and the \/dev/fd/\ virtual filesystem.
Sources/EmbeddedPlatform · high confidence
Add Foundation cross-import overlay for testing attachments
The \_Testing\_Foundation overlay is now built and installed via CMake, providing a bridge between the Testing library and Apple's Foundation framework. This overlay enables the use of Foundation types (such as URL, Data, and NSSecureCoding-compliant objects) as test attachments by wrapping them in the Attachable protocol, and re-exports the Testing module with experimental and tool-integration SPIs available.
_Sources/Overlays/\_Testing\Foundation · high confidence
Add JSON ABI encoding types for testing events and attachments
New types in the \ABI.Encoded\ module (e.g., \EncodedAttachment\, \EncodedEvent\, \EncodedIssue\, \EncodedTest\) now provide \Codable\ and \JSON.Encodable\ conformances, enabling the testing library to serialize test runs, issues, attachments, and metadata into a structured JSON event stream for integration with development tools.
Sources/Testing/ABI/Encoded · high confidence
Add NSImage attachment support for AppKit testing
Users can now attach NSImage instances to test results on Apple platforms. This new file implements the AttachableAsImage and AttachableAsCGImage protocols for NSImage, enabling the testing framework to capture and include images in test reports. The implementation handles scale factor calculation, converts images to CGImage representations, and manages thread-safety by checking if image representations are effectively Sendable, falling back to a safe TIFF-based copy when necessary.
_Sources/Overlays/\_Testing\AppKit/Attachments · high confidence
Add SymbolShowcase utility for previewing event symbol rendering
A new command-line utility, SymbolShowcase, has been added to preview how event symbols (such as pass, fail, skip, and warning) are rendered across different output styles, including Unicode, ANSI color, and SF Symbols on supported platforms. This tool allows users to visually verify symbol appearance in various terminal environments.
Sources/SymbolShowcase · high confidence
Add Windows SDK overlay for image attachments
A new CMake build target (\_Testing\_WinSDK) and source files have been added to support attaching images in tests on Windows. This includes Swift implementations for wrapping HBITMAP and HICON objects as attachable images using Windows Imaging Component (WIC) interfaces, along with a ReexportTesting module to expose the Testing framework. This enables Windows users to attach image data to test results, mirroring similar functionality available on other platforms.
_Sources/Overlays/\_Testing\WinSDK · high confidence
Add cross-import overlay for UIKit to support UIImage attachments
A new cross-import overlay module, \_Testing\_UIKit, has been added to enable attaching UIImage instances in tests on Apple platforms. This module re-exports the Testing and \_Testing\_CoreGraphics modules and includes a specific implementation for making UIImage attachable as an image, allowing users to integrate UIKit image assets directly into test attachments.
_Sources/Overlays/\_Testing\UIKit · high confidence
Add cross-import overlays for AppKit and CoreImage image attachments
New cross-import overlay modules (\_Testing\_AppKit and \_Testing\_CoreImage) are introduced to allow attaching NSImage and CIImage instances as test attachments. These modules re-export the Testing and \_Testing\_CoreGraphics libraries, enabling seamless integration of these specific image types within the testing framework on Darwin platforms.
_Sources/Overlays/\_Testing\AppKit · high confidence
Added unimplemented testing harness CLI tool
A new command-line tool named 'swift-testing-harness' has been added to the project. Currently, executing this tool immediately throws a validation error indicating it is unimplemented, serving as a placeholder for future testing infrastructure.
Sources/Harness · high confidence
Enhanced \#expect and \#require diagnostics with source location control and value capturing
The \\#expect\ and \\#require\ macros now accept an explicit \sourceLocation\ argument, allowing tests to override the default source attribution for recorded issues. Additionally, the framework has shifted from using \SourceCode\ to \Expression\ for tracking evaluated conditions, enabling the capture of runtime values within sub-expressions to improve failure diagnostics. The \\#expect(throws:)\ macro has been updated to return the thrown error instance (or \nil\ on failure) and now supports non-Void return types, while new overloads for \\#require\ provide specific diagnostics for ambiguous optional boolean values and redundant non-optional unwraps.
Sources/Testing/Expectations · high confidence
Expanded macro support and build system configuration for TestingMacros
The TestingMacros component now includes a CMake build configuration (CMakeLists.txt) that supports building the macro plugin as either a shared library or an executable, with specific handling for swift-syntax dependencies and RPATH settings. The macro implementation has been expanded to include new macros for handling exit test captured values (ExitTestCapturedValueMacro), pragma attributes (PragmaMacro), and source location tracking (SourceLocationMacro). Additionally, the existing condition macros (\#expect/\#require) have been enhanced to support isolation and source location arguments, while suite and test declaration macros now provide improved diagnostics for lexical context validation and generic attribute handling.
Sources/TestingMacros · high confidence
Foundation overlay adds support for attaching Encodable, NSSecureCoding, Data, and file URLs
The Testing Foundation overlay now provides default implementations for attaching Foundation types to test reports. Values conforming to \Encodable\ are serialized to JSON or property lists (XML or binary) based on the attachment's preferred name extension, while \NSSecureCoding\ objects are archived using \NSKeyedArchiver\. \Data\ instances are attached directly, and file or directory URLs can be attached via \Attachment(contentsOf:)\, which automatically compresses directories into ZIP archives. This enables developers to easily record structured data, raw bytes, and file contents in test output without manual serialization.
_Sources/Overlays/\_Testing\Foundation/Attachments · high confidence
Initial open-source release of Swift Testing with CMake build support
This change introduces the Swift Testing library as an open-source package, establishing the initial repository structure with a CMake build system (CMakeLists.txt) alongside the existing Swift Package Manager support. It includes configuration files for the Swift Package Index (.spi.yml), EditorConfig (.editorconfig), and license header management (.license\_header\_template, .licenseignore). The project is set to version 6.5-dev and provides comprehensive documentation in README.md and CONTRIBUTING.md, detailing installation, usage, and platform support (macOS, Linux, Windows, FreeBSD, and experimental Wasm/Android/OpenBSD). The repository also migrates URLs from the old apple/swift-testing organization to swiftlang/swift-testing and updates CI badges to reflect the new GitHub Actions workflows.
(repo-wide) · high confidence
Introduce exit test support in Swift Testing
This change adds the core implementation for exit tests, allowing you to spawn a child process and verify its exit status (success, failure, specific exit code, or signal). The \Sources/Testing/ExitTests\ location introduces the \ExitTest\ type and its nested types (\ExitStatus\, \Condition\, \Result\, \CapturedValue\) which define the API for these tests. It also includes the platform-specific process spawning logic (\SpawnProcess.swift\) and the waiting mechanisms (\WaitFor.swift\) that handle child process lifecycle and signal reporting across macOS, Linux, FreeBSD, OpenBSD, and Windows.
Sources/Testing/ExitTests · high confidence
Introduce parameterized testing infrastructure and argument encoding
This change adds the core types and logic required for parameterized testing in the Swift Testing library. It introduces the \Test.Case\ and \Test.Case.ID\ structures to represent individual test runs with specific argument combinations, including support for discriminators to distinguish repeated arguments. A new \CustomTestArgumentEncodable\ protocol allows types to define how their values are encoded into stable, unique IDs, enabling users to re-run specific test cases. The \Test.Case.Generator\ has been updated to accept \Test.Parameter\ information, allowing the framework to correctly map argument values to their corresponding function parameters and efficiently handle tuple de-structuring. Additionally, a \TypeInfo\ struct is added to describe the types of test parameters and values, supporting both concrete types and name-only representations for environments like Embedded Swift.
Sources/Testing/Parameterization · high confidence
New ABI entry point and command-line argument parsing for tools integration
The \Sources/Testing/ABI/EntryPoints\ module introduces a stable, version-agnostic ABI for external tools to invoke the Swift testing library. This includes \ABIEntryPoint.swift\, which exposes the \swt\_abiv0\getEntryPoint\ C function and an \EntryPoint\ type that streams JSON records to an in-process callback, and \SwiftPMEntryPoint.swift\, which provides the \\\_swiftPMEntryPoint\ function used by Swift Package Manager. The module also adds \CommandLineArgumentList.swift\, a lightweight argument parser used by the testing library to handle CLI inputs without depending on Swift Argument Parser, and \EmbeddedEntryPoint.swift\, which provides \swift\_testing\_embeddedMain\ to support Embedded Swift environments by draining the async main queue and capturing \argc\/\argv\/\environ\. These changes enable tools to integrate with the testing library via a stable C-compatible interface and support new platforms and execution models.
Sources/Testing/ABI/EntryPoints · high confidence
New attachment system for Swift Testing (Swift 6.2)
The testing library introduces a new attachment system available in Swift 6.2 and Xcode 26.0, allowing developers to record and save diagnostic data (such as images, logs, or custom types) alongside test results. This change adds the \Attachable\ protocol for types that can be serialized into bytes, the \Attachment\ struct to wrap and manage these values, and the \AttachableWrapper\ protocol to support types that cannot directly conform to \Attachable\. Users can now attach values to tests using \Attachment.record(\_:named:sourceLocation:)\, with automatic saving to disk if an attachments path is configured via the \--attachments-path\ CLI argument or \Configuration.attachmentsPath\.
Sources/Testing/Attachments · high confidence
New documentation for CMake builds, LLDB debugging, and distribution workflows
Added new documentation files to guide users on integrating Swift Testing with CMake (including ABI entry points and CTest), debugging tests via LLDB on Darwin and non-Darwin platforms, and obtaining the library through official distributions versus package dependencies. Also updated the Style Guide to require explicit types for public properties, mandate the \swift\testing\\ prefix for externally visible C/C++ symbols, and added guidance on writing compile-time diagnostics and symbol abstracts.
Documentation · high confidence
New event types, metadata recording, and configurable XCTest interop
The testing library now emits \testDiscovered\ and \metadataRecorded\ events, with the latter providing human-readable environment details (e.g., OS version, compiler version) to aid in diagnosing test issues. XCTest interoperability is now configurable via the \SWIFT\_TESTING\_XCTEST\_INTEROP\_MODE\ environment variable, allowing users to choose between \none\, \limited\, \complete\, or \strict\ modes to control how assertion failures from other test libraries are handled. Additionally, the \Event\ structure has been updated to reference tests and test cases by ID rather than including full instances, and deprecated events like \testBypassed\, \iterationStarted\, and \iterationEnded\ have been removed.
Sources/Testing/Events · high confidence
New fallback event handler for XCTest interop
A new \\_TestingInterop\ library has been added to support interoperability between Swift Testing and XCTest. This library introduces a fallback event handler mechanism that allows XCTest assertions (such as \XCTAssert\) executed within Swift Testing tests to report failures by encoding them as JSON events. The implementation ensures thread-safe, one-time installation of this handler to prevent runtime collisions when multiple copies of the testing library are loaded, and it is now exported as a CMake module for easier integration.
_Sources/\TestingInterop · high confidence
New internal headers for Embedded Swift, typed throws, and platform stubs
The \\_TestingInternals\ module now exposes several new C headers that extend the testing library's capabilities. \EmbeddedPlatform.h\ introduces the \swift\_testing\_embeddedMain\ entry point and helper functions (\\_swift\_testing\_getArgcArgv\, \\_swift\_testing\_getEnvironment\) to support running tests in Embedded Swift environments, including capturing command-line arguments and environment variables. \WillThrow.h\ adds support for capturing backtraces from typed throws via \swt\_setWillThrowTypedHandler\ and provides \swift\_getErrorValue\ for unboxing error existentials. \Demangle.h\ exposes \swift\_demangle\ for symbol demangling and a Windows-specific \DbgHelp\ wrapper. \Stubs.h\ (replacing the previous \Stubs.h\ which is now \ExecutablePath.h\) provides platform-specific C stubs, including atomic operations on Darwin, Mach port access, and Objective-C image discovery helpers. \Includes.h\ centralizes C standard and platform-specific header inclusions, while \Versions.h\ exposes library version, commit hash, and target triple information.
_Sources/\TestingInternals/include · high confidence
New source attribution types and backtrace symbolication
The library introduces new types for capturing and presenting source code context in test output, including \\_\Expression\ (replacing the old \SourceCode\ struct) to represent captured syntax nodes, \\\_SourceBounds\ to define source ranges, and \CustomTestReflectable\ and \CustomTestStringConvertible\ protocols to allow custom descriptions for test values. It also adds \Backtrace+Symbolication.swift\ to provide platform-specific symbolication for backtraces on macOS, Linux, Windows, and other supported OSes, and updates \Backtrace\ and \SourceContext\ to support \Codable\ for serialization.
Sources/Testing/SourceAttribution · high confidence
New traits for attachment saving, issue handling, and task-local binding
The testing library introduces three new traits in the Traits module. AttachmentSavingTrait allows tests to conditionally save recorded attachments based on pass/fail status or specific issue matching. IssueHandlingTrait enables tests to transform, filter, or suppress recorded issues via compactMapIssues and filterIssues. TaskLocalTrait allows binding a task-local value for the duration of a test or suite. Additionally, the Bug trait has been simplified to use URL and ID properties instead of a Relationship enum, and the Tag type has been removed in favor of string-based tags.
Sources/Testing/Traits · high confidence
Support attaching CGImage instances as test attachments on Apple platforms
On Apple platforms, \CGImage\ now conforms to \AttachableAsImage\, allowing developers to attach Core Graphics images directly to test results. The implementation uses \ImageIO\ to encode the image into a specified format (such as PNG or JPEG) or derives the format from the attachment's preferred name, handling orientation and scale factors during the conversion process.
_Sources/Overlays/\_Testing\CoreGraphics/Attachments · high confidence
Support bridging testing clock instants to Foundation Date
The testing library now allows converting its internal clock instants into Foundation's \Date\ type. A new initializer lets you create a \Date\ from a \Test.Clock.Instant\, mapping the testing timeline to wall-clock time, and another initializer supports decoding \Date\ instances from the ABI's \EncodedInstant\ for event stream processing. This change is available in environments where Foundation is not disabled and is excluded from Embedded Swift builds.
_Sources/Overlays/\_Testing\Foundation/Events · high confidence
Support for attaching CoreImage and UIKit images as test attachments
Users can now attach \CIImage\ and \UIImage\ instances directly in tests. New extension files implement the \AttachableAsImage\ and \AttachableAsCGImage\ protocols for these types, enabling them to be converted to \CGImage\ and included in test results. This capability is available starting with Swift 6.3 and Xcode 26.4.
_Sources/Overlays/\_Testing\_CoreImage/Attachments, Sources/Overlays/\_Testing\UIKit/Attachments · high confidence
Support for attaching Transferable values in test reports
The Testing library now allows attaching values that conform to the \Transferable\ protocol directly to test results. Users can create an \Attachment\ from any \Transferable\ and \Sendable\ value using the new \Attachment(exporting:as:named:)\ initializer, which automatically exports the value to data using the first content type that conforms to \UTType.data\. This feature is available in Swift 6.4 and Xcode 27.
_Sources/Overlays/\_Testing\CoreTransferable · high confidence
Swift Testing library build system and core API overhaul
The Swift Testing library has been restructured to support CMake as the primary build system, replacing previous build configurations. This change introduces a new \Color\ type for console output, enabling custom tag colors and ANSI escape code support. The testing API has been significantly updated: the \@Suite\ and \@Test\ macros now support non-copyable and non-escapable types, and test discovery has been refactored to use a new \TestContent\ record system. Additionally, test cancellation logic has been rewritten to use task-local storage for safer handling, and the \Test.ID\ type now includes \Codable\ conformance and improved key-path representation for better tooling integration.
Sources/Testing · high confidence
Removals
Removal of GitStatus build plugin
The GitStatus build tool plugin has been removed from the codebase. This plugin previously executed a GitStatus tool during the build process to capture the package repository state and generate a Swift source file containing version information. Its removal means this automatic generation of repository state data is no longer performed at build time.
Plugins/GitStatusPlugin · high confidence
Removal of the GitStatus plugin
The GitStatus plugin, which previously executed git commands to determine the repository's tag, commit hash, and uncommitted status to generate a version string for the testing library, has been removed. Users will no longer have this automatic version detection capability provided by this specific helper tool.
Sources/GitStatus · high confidence
Architecture
Testing support library refactored with new concurrency and I/O primitives
The internal support library for the testing framework has been significantly restructured to improve concurrency safety and cross-platform compatibility. The legacy \Locked\ property wrapper and \UncheckedSendable\ type have been removed and replaced with a checked \Mutex\ type and an \Allocated\ heap-boxing class for move-only values, ensuring stricter type safety. File I/O operations have been migrated to a dedicated \FileHandle\ type that abstracts away platform-specific C handles, while a new \CError\ type standardizes error reporting for POSIX and Windows APIs. Additionally, JSON encoding now supports a custom \Encodable\ protocol to function without Foundation, and the \Environment\ type has been updated to use \Mutex\ for thread-safe access to environment variables.
Sources/Testing/Support · high confidence
Behavioural changes
Enhanced macro expansion support for Embedded Swift, raw identifiers, and type diagnostics
The testing macros now provide better support for Embedded Swift by conditionally omitting type metadata from test function parameters when targeting Embedded Swift, and by recognizing the @\_unavailableInEmbedded attribute. The macro expansion logic now handles raw identifiers (backticked names) in function signatures and display names, and improves diagnostic accuracy by using lexical context to derive enclosing type names and detect unsupported generic patterns in suites. Additionally, the system now validates that bug report URLs are parseable, replaces CRC-32 with SHA-256 for generating unique thunk names, and refines availability attribute parsing to correctly handle wildcards and platform-specific unconditional availability.
Sources/TestingMacros/Support/Additions · high confidence
Introduce \_TestDiscovery library for platform-native test content discovery
A new internal \\TestDiscovery\ library has been added to replace legacy test discovery mechanisms. This library provides a unified, platform-specific implementation for discovering test content records stored in binary metadata sections (such as \\\_swift5\_tests\ on Darwin/ELF and \.sw5test\ on Windows/COFF). It introduces the \DiscoverableAsTestContent\ protocol and \TestContentRecord\ type, allowing the testing framework to dynamically locate and load test declarations, exit tests, and playgrounds directly from compiled binaries without relying on older, less robust discovery methods.
_Sources/\TestDiscovery · high confidence
Introduce \_TestingInternals C++ library for runtime support
The \_TestingInternals module is now built as a static C++ library (ExecutablePath.cpp, Versions.cpp, WillThrow.cpp) with CMake integration. This provides the testing framework with runtime capabilities including capturing the early working directory on OpenBSD, exposing the testing library version and commit hash, and registering Swift runtime error-handling hooks (willThrow and typed willThrow). The library is installed alongside the main library in static builds and includes platform-specific compiler flags for FreeBSD and MSVC.
_Sources/\TestingInternals · high confidence
New CMake build system for Swift Testing
The project now uses CMake to build and install Swift Testing, replacing the previous build method. This change introduces new CMake modules that handle platform detection (extracting target triple, platform, and architecture from the Swift compiler), version tracking (reading from VERSION.txt and Git commit hashes), and installation logic (installing Swift modules, interfaces, and cross-import overlays to the toolchain). Users building from source will now use CMake instead of Swift Package Manager or other legacy build scripts.
cmake · high confidence
Refactor tag representation and simplify console output
The tag system has been restructured to use a unified \Tag\ struct with a \Kind\ enum (replacing the previous \Tag\ enum with raw values), and the \@Tag\ macro now supports Embedded Swift. Predefined color tags (red, orange, yellow, green, blue, purple) and legacy System 7 label colors are now exposed via an experimental SPI. Console output for tags has been simplified to use the tag's description directly, removing complex source-code or raw-value logic.
Sources/Testing/Traits/Tags · high confidence
Refactor test content generation and replace CRC-32 with SHA-256
The macro support layer now uses SHA-256 instead of CRC-32 for generating test content identifiers, and introduces a new \TestContentGeneration\ helper that emits test records into platform-specific linker sections (e.g., \\_\_DATA\CONST,\\_swift5\_tests\ on Mach-O) using \@section\ and \@used\ attributes. Additionally, closure capture list parsing was improved to infer types for captured values, and diagnostics were added to validate \.bug()\ URLs and warn about effectful expectations.
Sources/TestingMacros/Support · high confidence
Refactor test discovery internals for static linking and pointer safety
The test discovery implementation in Sources/TestingInternals has been refactored to remove dependencies on \std::span\ and \constinit std::vector\, replacing C-style casts with \reinterpret\_cast\ for improved type safety. The code now distinguishes between dynamically linked and statically linked environments, providing a specific path for static linking that enumerates type metadata sections directly from the binary without relying on a dynamic linker. Additionally, the implementation introduces a custom heap allocator to avoid deadlocks when allocating memory while holding dyld or libobjc locks, and adds logic to ignore Swift types in the Darwin/dyld shared cache during discovery.
Sources/TestingInternals · high confidence
Removal of internal C header files for type discovery and standard includes
The internal testing library has removed the \Discovery.h\ and \Includes.h\ header files from the \Sources/TestingInternals/include\ directory. \Discovery.h\ previously exposed the \swt\_enumerateTypes\ function and associated callback types for enumerating Swift types, while \Includes.h\ managed the inclusion of C standard library headers (such as \stdio.h\, \stdlib.h\, and platform-specific headers) for the testing internals. These changes reflect a shift in how the testing framework handles type discovery and C library dependencies internally.
Sources/TestingInternals/include · high confidence
Windows image attachments now use the Windows Imaging Component (WIC)
Image attachments on Windows now leverage the Windows Imaging Component (WIC) instead of GDI+, enabling direct attachment of native Windows handles like \HBITMAP\ and \HICON\ as well as \IWICBitmapSource\ instances. This change introduces a new \encoderCLSID\ property on \AttachableImageFormat\ to identify specific image encoders, automatically appends the correct file extensions based on the encoder, and ensures that image encoding quality settings are correctly applied during serialization.
_Sources/Overlays/\_Testing\WinSDK/Attachments · high confidence
Test coverage
Added cross-import overlay tests for AppKit, CoreGraphics, CoreImage, CoreTransferable, Foundation, UIKit, and WinSDK; Added memory-safety test declarations; Added tests for ABI JSON encoding, test discovery, and console output recording; Added tests for Test.Clock.Instant to Date casting; Added tests for image attachment support; Added tests for new and updated testing traits; Added tests for support library components; Added tests for the new JSON ABI Context and Record streaming types; Expanded test coverage for TestingMacros diagnostics and macro expansions; Expanded test support infrastructure for macro diagnostics and embedded Swift; New and updated Swift Testing documentation articles; New test output recorder components and symbol definitions; Refactor test running infrastructure and configuration handling; Testing library introduces issue severity levels and serializable error snapshots; Testing library support additions for Embedded Swift and cross-platform compatibility; Updated test support utilities to align with testing library API changes.
Dependencies
Swift 6.3 toolchain support and expanded platform coverage
The package now requires Swift 6.3, raising the minimum toolchain version from 5.9. Platform deployment targets have been updated to macOS 14, iOS 17, watchOS 10, tvOS 17, and visionOS 1, with additional support for macCatalyst. The swift-syntax dependency has been upgraded to version 605.0.0, and the package now includes new products for test discovery and a testing harness, alongside cross-import overlays for AppKit, CoreGraphics, CoreImage, CoreTransferable, Foundation, UIKit, and WinSDK to support richer test attachments.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 65 → 55 (-10.8)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 89 → 88 (-1.1)
- Architecture 94 → 68 (-25.8)
- Maturity 56 → 56 (-0.4)
- Readiness 55 → 39 (-15.9)
- Security 90 → 90 (+0.0)
- Performance 98 (new)
Resolved (11)
- Documentation: no installation or build instructions (README.md)
- EncodedAttachment.encode (cognitive 19) (Sources/Testing/ABI/Encoded/ABI.EncodedAttachment.swift)
- Environment.variable (cognitive 19) (Sources/Testing/Support/Environment.swift)
- Environment.variable (cyclomatic 17) (Sources/Testing/Support/Environment.swift)
- FixmeComment (Sources/Testing/SourceAttribution/CustomTestStringConvertible.swift)
- Further sole-owners (lower concentration)
- Hotspot: Sources/Testing/Support/FileHandle.swift (Sources/Testing/Support/FileHandle.swift)
- No assertions: filterOrSkipAsLast (Tests/TestingTests/SwiftPMTests.swift)
- No assertions: testSynchronousTestFunctionRunsOnMainActorWhenEnforced (Tests/TestingTests/RunnerTests.swift)
- Off-boarding risk: anonymized user #1
- TodoComment (Package.swift)
New (64)
- AvailabilityGuards.swift.createSyntaxNode (cognitive 23) (Sources/TestingMacros/Support/AvailabilityGuards.swift)
- CommandLine.executablePath (cognitive 23) (Sources/Testing/Support/Additions/CommandLineAdditions.swift)
- CommandLine.executablePath (cyclomatic 19) (Sources/Testing/Support/Additions/CommandLineAdditions.swift)
- CommandLineArgumentList._parseArgument (cognitive 20) (Sources/Testing/ABI/EntryPoints/CommandLineArgumentList.swift)
- CommentParsing.swift._trimTriviaToLastDoubleNewline (cognitive 21) (Sources/TestingMacros/Support/CommentParsing.swift)
- Coverage not measured — Swift suite
- Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
- DiagnosticMessage+Diagnosing.swift._diagnoseIssuesWithTagsTrait (cognitive 28) (Sources/TestingMacros/Support/DiagnosticMessage+Diagnosing.swift)
- DiagnosticMessage+Diagnosing.swift.diagnoseIssuesWithLexicalContext (cognitive 18) (Sources/TestingMacros/Support/DiagnosticMessage+Diagnosing.swift)
- Duplicated block (10 lines × 2) (Sources/Testing/Issues/Issue.swift)
- Duplicated block (10 lines × 2) (Sources/Testing/Issues/Issue.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (11 lines × 3) (Sources/EmbeddedPlatform/EmbeddedPlatformPOSIX+WASI.swift)
- Duplicated block (12 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- Duplicated block (15 lines × 2) (Sources/Testing/Expectations/ExpectationChecking+Macro.swift)
- …and 44 more
Changes since last survey
- 25 commits — 22 feature/other, 3 fixes
By area
- Sources/Testing — 19 commits
- Sources/EmbeddedPlatform — 3 commits
- (root) — 1 commit
- Documentation/EnvironmentVariables.md — 1 commit
- Sources/TestingMacros — 1 commit
Notable commits
- fix: Fix incorrect message strings being emitted when a non-parameterized test's events are swapped for test case events. (#1929)
- fix: Fix repetition handling for non-failure issues (#1916)
- fix: Revert "Add a "Showcase" target for Embedded Swift."
- change: Add a "Showcase" target for Embedded Swift.
- change: Add a "Showcase" target for Embedded Swift. (#1922)
- change: Add a dedicated argument parser system. (#1849)
- change: Add support for capturing argc/argv, and environ in Embedded Swift. (#1926)
- change: Disable error backtrace capturing in Embedded Swift. (#1906)
- change: Enable value capturing in #expect() in Embedded Swift. (#1930)
- change: Escape JUnit XML test names and class names (#1918)
- change: Implement a custom replacement for JSONEncoder. (#1914)
- change: Improve performance of ABI.VersionNumber.init(fromRecordJSON:) (#1858)
- change: Modify Embedded Swift's JSON-writing callback to allow some basic configuration. (#1928)
- change: Provide a basic implementation of the PAL annex for POSIX targets. (#1920)
- change: Remaining Embedded Swift support work (#1866)
- change: Remove Embedded-specific code paths for argument capturing. (#1936)
- change: Remove .timeLimit and .serialized from Embedded Swift. (#1931)
- change: Remove defaultSynchronousIsolationContext from Embedded Swift. (#1907)
- change: Remove old deprecated SPI and guard deprecated API from Embedded Swift. (#1898)
- change: Separate the WASI PAL implementation out to its own file. (#1927)
- …and 5 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
swiftlang/swift-testing was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b5c410c06b1d1bf31b4d1baa27416b67fac2ab61 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.