Skip to content

Commit ac03c3a

Browse files
committed
Merge branch 'main' into main-6.3-merge
2 parents 9603011 + 98430f2 commit ac03c3a

File tree

4 files changed

+37
-41
lines changed

4 files changed

+37
-41
lines changed

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,23 @@ Swift.
106106
The table below describes the current level of support that Swift Testing has
107107
for various platforms:
108108

109-
| **Platform** | **Support Status** |
110-
|-|-|
111-
| Apple platforms | Supported |
112-
| Linux | Supported |
113-
| Windows | Supported |
114-
| FreeBSD, OpenBSD | Experimental |
115-
| Wasm | Experimental |
116-
| Android | Experimental |
109+
| **Platform** | **Support Status** | **Qualification[^1]** |
110+
| ---------------- | ------------------ | ---------------------- |
111+
| Apple platforms | Supported | Automated |
112+
| Linux | Supported | Automated |
113+
| Windows | Supported | Automated |
114+
| Wasm | Experimental | Automated (Build Only) |
115+
| Android | Experimental | Automated (Build Only) |
116+
| FreeBSD, OpenBSD | Experimental | Manual |
117+
118+
[^1]:
119+
Most platforms have "Automated" qualification, where continuous integration
120+
automatically verifies that the project builds and passes all tests. This
121+
ensures that any changes meet our highest quality standards, so it is our
122+
goal for all supported platforms.
123+
124+
Presently, some platforms rely on manual test ("Automated (Build Only)"
125+
qualification) or manual build and test ("Manual" qualification).
117126

118127
### Works with XCTest
119128

@@ -127,7 +136,7 @@ Detailed documentation for Swift Testing can be found on the
127136
[Swift Package Index](https://swiftpackageindex.com/swiftlang/swift-testing/main/documentation/testing).
128137
There, you can delve into comprehensive guides, tutorials, and API references to
129138
make the most out of this package. Swift Testing is included with the Swift 6
130-
toolchain and Xcode 16. You do not need to add it as a package dependency to
139+
toolchain and Xcode 16. You do not need to add it as a package dependency to
131140
your Swift package or Xcode project.
132141

133142
> [!IMPORTANT]
@@ -136,5 +145,5 @@ your Swift package or Xcode project.
136145
> repository requires a recent **main-branch development snapshot** toolchain.
137146
138147
Other documentation resources for this project can be found in the
139-
[README](https://github.com/swiftlang/swift-testing/blob/main/Documentation/README.md)
148+
[README](https://github.com/swiftlang/swift-testing/blob/main/Documentation/README.md)
140149
of the `Documentation/` subdirectory.

Sources/Testing/Test+Cancellation.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ extension Test: TestCancellable {
195195
/// attribute the cancellation.
196196
///
197197
/// - Throws: An error indicating that the current test or test case has been
198-
/// cancelled.
198+
/// cancelled. The testing library does not treat this error as a test
199+
/// failure.
199200
///
200201
/// The testing library runs each test and each test case in its own task.
201202
/// When you call this function, the testing library cancels the task
@@ -222,17 +223,13 @@ extension Test: TestCancellable {
222223
/// current test has been cancelled, but does not attempt to cancel the test a
223224
/// second time.
224225
///
225-
/// @Comment {
226-
/// TODO: Document the interaction between an exit test and test
227-
/// cancellation. In particular, the error thrown by this function isn't
228-
/// thrown into the parent process and task cancellation doesn't propagate
229-
/// (because the exit test _de facto_ runs in a detached task.)
230-
/// }
231-
///
232226
/// - Important: If the current task is not associated with a test (for
233227
/// example, because it was created with [`Task.detached(name:priority:operation:)`](https://developer.apple.com/documentation/swift/task/detached(name:priority:operation:)-795w1))
234228
/// this function records an issue and cancels the current task.
235-
@_spi(Experimental)
229+
///
230+
/// @Metadata {
231+
/// @Available(Swift, introduced: 6.3)
232+
/// }
236233
public static func cancel(_ comment: Comment? = nil, sourceLocation: SourceLocation = #_sourceLocation) throws -> Never {
237234
let skipInfo = SkipInfo(comment: comment, sourceContext: SourceContext(backtrace: nil, sourceLocation: sourceLocation))
238235
try Self.cancel(with: skipInfo)

Sources/Testing/Testing.docc/EnablingAndDisabling.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,17 @@ func allIngredientsAvailable(for food: Food) -> Bool { ... }
121121
func makeSundae() async throws { ... }
122122
```
123123

124-
<!--
125124
### End a test after it has already started
126125

127-
TODO: document Test.cancel() and Test.Case.cancel() here
128-
129-
If a test has already started running and you determine it cannot complete and
130-
should end early without failing, use ``Test/cancel(_:sourceLocation:)`` to
131-
cancel the test:
126+
If a test is running and you determine it cannot complete and should end early
127+
without failing, use ``Test/cancel(_:sourceLocation:)`` to cancel the test:
132128

133129
```swift
134-
...
130+
@Test("Can make sundaes")
131+
func makeSundae() throws {
132+
guard let iceCreamMaker = IceCreamMaker() else {
133+
try Test.cancel("The ice cream maker isn't working right now")
134+
}
135+
...
136+
}
135137
```
136-
137-
If the test is parameterized and you only want to cancel the current test case
138-
rather than the entire test, use ``Test/Case/cancel(_:sourceLocation:)``.
139-
-->

Sources/Testing/Testing.docc/MigratingFromXCTest.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -556,13 +556,9 @@ test function with an instance of this trait type to control whether it runs:
556556
}
557557
}
558558

559-
<!-- TODO: document Test.cancel() and Test.Case.cancel() here, and update
560-
relevant links to use proper DocC symbol references.
561-
562-
If a test has already started running and you determine it cannot complete and
563-
should end early without failing, use `Test/cancel(_:sourceLocation:)` instead
564-
of [`XCTSkip`](https://developer.apple.com/documentation/xctest/xctskip) to
565-
cancel the task associated with the current test:
559+
If a test is running and you determine it cannot complete and should end early
560+
without failing, use ``Test/cancel(_:sourceLocation:)`` instead of [`XCTSkip`](https://developer.apple.com/documentation/xctest/xctskip)
561+
to cancel the task associated with the current test:
566562

567563
@Row {
568564
@Column {
@@ -593,10 +589,6 @@ cancel the task associated with the current test:
593589
}
594590
}
595591

596-
If the test is parameterized and you only want to cancel the current test case
597-
rather than the entire test, use `Test/Case/cancel(_:sourceLocation:)`.
598-
-->
599-
600592
### Annotate known issues
601593

602594
A test may have a known issue that sometimes or always prevents it from passing.

0 commit comments

Comments
 (0)