Skip to content

Commit 3abeccb

Browse files
author
Sean Olszewski
committed
Conditionally compile out async setup/teardown variants on Windows
1 parent ad8f592 commit 3abeccb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/XCTest/Public/XCAbstractTest.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ open class XCTest {
5252
perform(testRun!)
5353
}
5454

55+
/// Async setup method called before the invocation of `setUpWithError` for each test method in the class.
56+
#if !os(Windows)
57+
@available(macOS 12.0, *)
58+
open func setUp() async throws {}
59+
#endif
5560
/// Setup method called before the invocation of `setUp` and the test method
5661
/// for each test method in the class.
5762
open func setUpWithError() throws {}
@@ -68,6 +73,12 @@ open class XCTest {
6873
/// for each test method in the class.
6974
open func tearDownWithError() throws {}
7075

76+
/// Async teardown method which is called after the invocation of `tearDownWithError`
77+
/// for each test method in the class.
78+
#if !os(Windows)
79+
@available(macOS 12.0, *)
80+
open func tearDown() async throws {}
81+
#endif
7182
// FIXME: This initializer is required due to a Swift compiler bug on Linux.
7283
// It should be removed once the bug is fixed.
7384
public init() {}

0 commit comments

Comments
 (0)