Skip to content

Commit 5e55e67

Browse files
Move XCTest API availability information to the porting guide
1 parent 31b6ecf commit 5e55e67

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

src/getting-started/porting.md

+17
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,20 @@ and they had to be disabled. These types are therefore absent in SwiftWasm Found
7676
Related functions and properties on other types are also absent or disabled. We would like to make
7777
them available in the future as soon as possible, and [we invite you to
7878
contribute](../contribution-guide/index.md) and help us in achieving this goal!
79+
80+
81+
## XCTest
82+
83+
[The swift-corelibs-xctest project](https://github.com/swiftlang/swift-corelibs-xctest) is available
84+
in WebAssembly platforms, and you can use it to write tests for your SwiftWasm projects.
85+
86+
The following XCTest features are unavailable in SwiftWasm:
87+
88+
| API | Status |
89+
|----------------|--------|
90+
| `XCTestExpectation` | ❌ Unavailable |
91+
| `XCTNSPredicateExpectation` | ❌ Unavailable |
92+
| `XCTNSNotificationExpectation` | ❌ Unavailable |
93+
| `XCTWaiter` | ❌ Unavailable |
94+
| `XCTest.perform` | ❌ Unavailable |
95+
| `XCTest.run` | ❌ Unavailable |

src/getting-started/testing.md

-9
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ for this test to pass. Your test functions should all start with `test`, please
4747
documentation](https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods)
4848
for more details.
4949

50-
## XCTest limitations in the SwiftWasm toolchain
51-
52-
As was mentioned in [our section about Swift Foundation](/foundation.md), multi-threading and
53-
file system APIs are currently not available in SwiftWasm. This means that `XCTestExpectation`
54-
and test hooks related to `Bundle` (such as `testBundleWillStart(_:)` and `testBundleDidFinish(_:)`)
55-
are not available in test suites compiled with SwiftWasm. If you have an existing test suite you're
56-
porting to WebAssembly, you should use `#if os(WASI)` directives to exclude places where you use
57-
these APIs from compilation.
58-
5950
## Building and running the test suite with `SwiftPM`
6051

6152
You can build your test suite by running this command in your terminal:

0 commit comments

Comments
 (0)