Skip to content

Commit c0108ad

Browse files
authored
Declare Xcode 26 availability for all Swift 6.2 APIs (#1148)
This declares Xcode 26.0 API availability for all Swift 6.2 declarations. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated. Fixes rdar://151629765
1 parent b0a1efd commit c0108ad

15 files changed

+45
-0
lines changed

Sources/Overlays/_Testing_Foundation/Attachments/Attachable+Encodable+NSSecureCoding.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public import Foundation
2020

2121
/// @Metadata {
2222
/// @Available(Swift, introduced: 6.2)
23+
/// @Available(Xcode, introduced: 26.0)
2324
/// }
2425
extension Attachable where Self: Encodable & NSSecureCoding {
2526
@_documentation(visibility: private)

Sources/Overlays/_Testing_Foundation/Attachments/Attachable+Encodable.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func withUnsafeBytes<E, R>(encoding attachableValue: borrowing E, for attachment
5656

5757
/// @Metadata {
5858
/// @Available(Swift, introduced: 6.2)
59+
/// @Available(Xcode, introduced: 26.0)
5960
/// }
6061
extension Attachable where Self: Encodable {
6162
/// Encode this value into a buffer using either [`PropertyListEncoder`](https://developer.apple.com/documentation/foundation/propertylistencoder)
@@ -92,6 +93,7 @@ extension Attachable where Self: Encodable {
9293
///
9394
/// @Metadata {
9495
/// @Available(Swift, introduced: 6.2)
96+
/// @Available(Xcode, introduced: 26.0)
9597
/// }
9698
public func withUnsafeBytes<R>(for attachment: borrowing Attachment<Self>, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
9799
try _Testing_Foundation.withUnsafeBytes(encoding: self, for: attachment, body)

Sources/Overlays/_Testing_Foundation/Attachments/Attachable+NSSecureCoding.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public import Foundation
1818

1919
/// @Metadata {
2020
/// @Available(Swift, introduced: 6.2)
21+
/// @Available(Xcode, introduced: 26.0)
2122
/// }
2223
extension Attachable where Self: NSSecureCoding {
2324
/// Encode this object using [`NSKeyedArchiver`](https://developer.apple.com/documentation/foundation/nskeyedarchiver)
@@ -52,6 +53,7 @@ extension Attachable where Self: NSSecureCoding {
5253
///
5354
/// @Metadata {
5455
/// @Available(Swift, introduced: 6.2)
56+
/// @Available(Xcode, introduced: 26.0)
5557
/// }
5658
public func withUnsafeBytes<R>(for attachment: borrowing Attachment<Self>, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
5759
let format = try EncodingFormat(for: attachment)

Sources/Overlays/_Testing_Foundation/Attachments/Attachment+URL.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extension Attachment where AttachableValue == _AttachableURLWrapper {
5353
///
5454
/// @Metadata {
5555
/// @Available(Swift, introduced: 6.2)
56+
/// @Available(Xcode, introduced: 26.0)
5657
/// }
5758
public init(
5859
contentsOf url: URL,

Sources/Overlays/_Testing_Foundation/Attachments/Data+Attachable.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ public import Foundation
1414

1515
/// @Metadata {
1616
/// @Available(Swift, introduced: 6.2)
17+
/// @Available(Xcode, introduced: 26.0)
1718
/// }
1819
extension Data: Attachable {
1920
/// @Metadata {
2021
/// @Available(Swift, introduced: 6.2)
22+
/// @Available(Xcode, introduced: 26.0)
2123
/// }
2224
public func withUnsafeBytes<R>(for attachment: borrowing Attachment<Self>, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
2325
try withUnsafeBytes(body)

Sources/Testing/Attachments/Attachable.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
///
3030
/// @Metadata {
3131
/// @Available(Swift, introduced: 6.2)
32+
/// @Available(Xcode, introduced: 26.0)
3233
/// }
3334
public protocol Attachable: ~Copyable {
3435
/// An estimate of the number of bytes of memory needed to store this value as
@@ -48,6 +49,7 @@ public protocol Attachable: ~Copyable {
4849
///
4950
/// @Metadata {
5051
/// @Available(Swift, introduced: 6.2)
52+
/// @Available(Xcode, introduced: 26.0)
5153
/// }
5254
var estimatedAttachmentByteCount: Int? { get }
5355

@@ -74,6 +76,7 @@ public protocol Attachable: ~Copyable {
7476
///
7577
/// @Metadata {
7678
/// @Available(Swift, introduced: 6.2)
79+
/// @Available(Xcode, introduced: 26.0)
7780
/// }
7881
borrowing func withUnsafeBytes<R>(for attachment: borrowing Attachment<Self>, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R
7982

@@ -94,6 +97,7 @@ public protocol Attachable: ~Copyable {
9497
///
9598
/// @Metadata {
9699
/// @Available(Swift, introduced: 6.2)
100+
/// @Available(Xcode, introduced: 26.0)
97101
/// }
98102
borrowing func preferredName(for attachment: borrowing Attachment<Self>, basedOn suggestedName: String) -> String
99103
}

Sources/Testing/Attachments/AttachableWrapper.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@
2424
///
2525
/// @Metadata {
2626
/// @Available(Swift, introduced: 6.2)
27+
/// @Available(Xcode, introduced: 26.0)
2728
/// }
2829
public protocol AttachableWrapper<Wrapped>: Attachable, ~Copyable {
2930
/// The type of the underlying value represented by this type.
3031
///
3132
/// @Metadata {
3233
/// @Available(Swift, introduced: 6.2)
34+
/// @Available(Xcode, introduced: 26.0)
3335
/// }
3436
associatedtype Wrapped
3537

3638
/// The underlying value represented by this instance.
3739
///
3840
/// @Metadata {
3941
/// @Available(Swift, introduced: 6.2)
42+
/// @Available(Xcode, introduced: 26.0)
4043
/// }
4144
var wrappedValue: Wrapped { get }
4245
}

Sources/Testing/Attachments/Attachment.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ private import _TestingInternals
2121
///
2222
/// @Metadata {
2323
/// @Available(Swift, introduced: 6.2)
24+
/// @Available(Xcode, introduced: 26.0)
2425
/// }
2526
public struct Attachment<AttachableValue>: ~Copyable where AttachableValue: Attachable & ~Copyable {
2627
/// Storage for ``attachableValue-7dyjv``.
@@ -57,6 +58,7 @@ public struct Attachment<AttachableValue>: ~Copyable where AttachableValue: Atta
5758
///
5859
/// @Metadata {
5960
/// @Available(Swift, introduced: 6.2)
61+
/// @Available(Xcode, introduced: 26.0)
6062
/// }
6163
public var preferredName: String {
6264
let suggestedName = if let _preferredName, !_preferredName.isEmpty {
@@ -100,6 +102,7 @@ extension Attachment where AttachableValue: ~Copyable {
100102
///
101103
/// @Metadata {
102104
/// @Available(Swift, introduced: 6.2)
105+
/// @Available(Xcode, introduced: 26.0)
103106
/// }
104107
public init(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
105108
self._attachableValue = attachableValue
@@ -194,6 +197,7 @@ extension Attachment where AttachableValue: ~Copyable {
194197
extension Attachment: CustomStringConvertible {
195198
/// @Metadata {
196199
/// @Available(Swift, introduced: 6.2)
200+
/// @Available(Xcode, introduced: 26.0)
197201
/// }
198202
public var description: String {
199203
#""\#(preferredName)": \#(String(describingForTest: attachableValue))"#
@@ -207,6 +211,7 @@ extension Attachment where AttachableValue: ~Copyable {
207211
///
208212
/// @Metadata {
209213
/// @Available(Swift, introduced: 6.2)
214+
/// @Available(Xcode, introduced: 26.0)
210215
/// }
211216
@_disfavoredOverload public var attachableValue: AttachableValue {
212217
_read {
@@ -229,6 +234,7 @@ extension Attachment where AttachableValue: AttachableWrapper & ~Copyable {
229234
///
230235
/// @Metadata {
231236
/// @Available(Swift, introduced: 6.2)
237+
/// @Available(Xcode, introduced: 26.0)
232238
/// }
233239
public var attachableValue: AttachableValue.Wrapped {
234240
_read {
@@ -259,6 +265,7 @@ extension Attachment where AttachableValue: Sendable & Copyable {
259265
///
260266
/// @Metadata {
261267
/// @Available(Swift, introduced: 6.2)
268+
/// @Available(Xcode, introduced: 26.0)
262269
/// }
263270
@_documentation(visibility: private)
264271
public static func record(_ attachment: consuming Self, sourceLocation: SourceLocation = #_sourceLocation) {
@@ -291,6 +298,7 @@ extension Attachment where AttachableValue: Sendable & Copyable {
291298
///
292299
/// @Metadata {
293300
/// @Available(Swift, introduced: 6.2)
301+
/// @Available(Xcode, introduced: 26.0)
294302
/// }
295303
@_documentation(visibility: private)
296304
public static func record(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
@@ -318,6 +326,7 @@ extension Attachment where AttachableValue: ~Copyable {
318326
///
319327
/// @Metadata {
320328
/// @Available(Swift, introduced: 6.2)
329+
/// @Available(Xcode, introduced: 26.0)
321330
/// }
322331
public static func record(_ attachment: consuming Self, sourceLocation: SourceLocation = #_sourceLocation) {
323332
do {
@@ -361,6 +370,7 @@ extension Attachment where AttachableValue: ~Copyable {
361370
///
362371
/// @Metadata {
363372
/// @Available(Swift, introduced: 6.2)
373+
/// @Available(Xcode, introduced: 26.0)
364374
/// }
365375
public static func record(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
366376
record(Self(attachableValue, named: preferredName, sourceLocation: sourceLocation), sourceLocation: sourceLocation)
@@ -389,6 +399,7 @@ extension Attachment where AttachableValue: ~Copyable {
389399
///
390400
/// @Metadata {
391401
/// @Available(Swift, introduced: 6.2)
402+
/// @Available(Xcode, introduced: 26.0)
392403
/// }
393404
@inlinable public borrowing func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
394405
try attachableValue.withUnsafeBytes(for: self, body)

Sources/Testing/ExitTests/ExitStatus.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ private import _TestingInternals
2121
///
2222
/// @Metadata {
2323
/// @Available(Swift, introduced: 6.2)
24+
/// @Available(Xcode, introduced: 26.0)
2425
/// }
2526
#if SWT_NO_PROCESS_SPAWNING
2627
@available(*, unavailable, message: "Exit tests are not available on this platform.")
@@ -55,6 +56,7 @@ public enum ExitStatus: Sendable {
5556
///
5657
/// @Metadata {
5758
/// @Available(Swift, introduced: 6.2)
59+
/// @Available(Xcode, introduced: 26.0)
5860
/// }
5961
case exitCode(_ exitCode: CInt)
6062

@@ -81,6 +83,7 @@ public enum ExitStatus: Sendable {
8183
///
8284
/// @Metadata {
8385
/// @Available(Swift, introduced: 6.2)
86+
/// @Available(Xcode, introduced: 26.0)
8487
/// }
8588
case signal(_ signal: CInt)
8689
}

Sources/Testing/ExitTests/ExitTest.Condition.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ extension ExitTest {
3535
///
3636
/// @Metadata {
3737
/// @Available(Swift, introduced: 6.2)
38+
/// @Available(Xcode, introduced: 26.0)
3839
/// }
3940
public struct Condition: Sendable {
4041
/// An enumeration describing the possible conditions for an exit test.
@@ -66,6 +67,7 @@ extension ExitTest.Condition {
6667
///
6768
/// @Metadata {
6869
/// @Available(Swift, introduced: 6.2)
70+
/// @Available(Xcode, introduced: 26.0)
6971
/// }
7072
public static var success: Self {
7173
Self(_kind: .success)
@@ -78,6 +80,7 @@ extension ExitTest.Condition {
7880
///
7981
/// @Metadata {
8082
/// @Available(Swift, introduced: 6.2)
83+
/// @Available(Xcode, introduced: 26.0)
8184
/// }
8285
public static var failure: Self {
8386
Self(_kind: .failure)
@@ -91,6 +94,7 @@ extension ExitTest.Condition {
9194
///
9295
/// @Metadata {
9396
/// @Available(Swift, introduced: 6.2)
97+
/// @Available(Xcode, introduced: 26.0)
9498
/// }
9599
public init(_ exitStatus: ExitStatus) {
96100
self.init(_kind: .exitStatus(exitStatus))
@@ -126,6 +130,7 @@ extension ExitTest.Condition {
126130
///
127131
/// @Metadata {
128132
/// @Available(Swift, introduced: 6.2)
133+
/// @Available(Xcode, introduced: 26.0)
129134
/// }
130135
public static func exitCode(_ exitCode: CInt) -> Self {
131136
#if !SWT_NO_EXIT_TESTS
@@ -158,6 +163,7 @@ extension ExitTest.Condition {
158163
///
159164
/// @Metadata {
160165
/// @Available(Swift, introduced: 6.2)
166+
/// @Available(Xcode, introduced: 26.0)
161167
/// }
162168
public static func signal(_ signal: CInt) -> Self {
163169
#if !SWT_NO_EXIT_TESTS

Sources/Testing/ExitTests/ExitTest.Result.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ extension ExitTest {
2121
///
2222
/// @Metadata {
2323
/// @Available(Swift, introduced: 6.2)
24+
/// @Available(Xcode, introduced: 26.0)
2425
/// }
2526
public struct Result: Sendable {
2627
/// The exit status reported by the process hosting the exit test.
2728
///
2829
/// @Metadata {
2930
/// @Available(Swift, introduced: 6.2)
31+
/// @Available(Xcode, introduced: 26.0)
3032
/// }
3133
public var exitStatus: ExitStatus
3234

@@ -57,6 +59,7 @@ extension ExitTest {
5759
///
5860
/// @Metadata {
5961
/// @Available(Swift, introduced: 6.2)
62+
/// @Available(Xcode, introduced: 26.0)
6063
/// }
6164
public var standardOutputContent: [UInt8] = []
6265

@@ -87,6 +90,7 @@ extension ExitTest {
8790
///
8891
/// @Metadata {
8992
/// @Available(Swift, introduced: 6.2)
93+
/// @Available(Xcode, introduced: 26.0)
9094
/// }
9195
public var standardErrorContent: [UInt8] = []
9296

Sources/Testing/ExitTests/ExitTest.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private import _TestingInternals
3232
///
3333
/// @Metadata {
3434
/// @Available(Swift, introduced: 6.2)
35+
/// @Available(Xcode, introduced: 26.0)
3536
/// }
3637
#if SWT_NO_EXIT_TESTS
3738
@available(*, unavailable, message: "Exit tests are not available on this platform.")
@@ -170,6 +171,7 @@ extension ExitTest {
170171
///
171172
/// @Metadata {
172173
/// @Available(Swift, introduced: 6.2)
174+
/// @Available(Xcode, introduced: 26.0)
173175
/// }
174176
public static var current: ExitTest? {
175177
_read {

Sources/Testing/Expectations/Expectation+Macro.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ public macro require<R>(
513513
///
514514
/// @Metadata {
515515
/// @Available(Swift, introduced: 6.2)
516+
/// @Available(Xcode, introduced: 26.0)
516517
/// }
517518
@freestanding(expression)
518519
@discardableResult
@@ -559,6 +560,7 @@ public macro expect(
559560
///
560561
/// @Metadata {
561562
/// @Available(Swift, introduced: 6.2)
563+
/// @Available(Xcode, introduced: 26.0)
562564
/// }
563565
@freestanding(expression)
564566
@discardableResult

Sources/Testing/Testing.docc/exit-testing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ See https://swift.org/CONTRIBUTORS.txt for Swift project authors
1212

1313
@Metadata {
1414
@Available(Swift, introduced: 6.2)
15+
@Available(Xcode, introduced: 26.0)
1516
}
1617

1718
Use exit tests to test functionality that might cause a test process to exit.

Sources/Testing/Traits/ConditionTrait.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public struct ConditionTrait: TestTrait, SuiteTrait {
7272
///
7373
/// @Metadata {
7474
/// @Available(Swift, introduced: 6.2)
75+
/// @Available(Xcode, introduced: 26.0)
7576
/// }
7677
public func evaluate() async throws -> Bool {
7778
switch kind {

0 commit comments

Comments
 (0)