diff --git a/src/getting-started/porting.md b/src/getting-started/porting.md index 400dc24..bd91ad2 100644 --- a/src/getting-started/porting.md +++ b/src/getting-started/porting.md @@ -76,3 +76,20 @@ and they had to be disabled. These types are therefore absent in SwiftWasm Found Related functions and properties on other types are also absent or disabled. We would like to make them available in the future as soon as possible, and [we invite you to contribute](../contribution-guide/index.md) and help us in achieving this goal! + + +## XCTest + +[The swift-corelibs-xctest project](https://github.com/swiftlang/swift-corelibs-xctest) is available +in WebAssembly platforms, and you can use it to write tests for your SwiftWasm projects. + +The following XCTest features are unavailable in SwiftWasm: + +| API | Status | +|----------------|--------| +| `XCTestExpectation` | ❌ Unavailable | +| `XCTNSPredicateExpectation` | ❌ Unavailable | +| `XCTNSNotificationExpectation` | ❌ Unavailable | +| `XCTWaiter` | ❌ Unavailable | +| `XCTest.perform` | ❌ Unavailable | +| `XCTest.run` | ❌ Unavailable | diff --git a/src/getting-started/testing.md b/src/getting-started/testing.md index fb3b019..e9c20a0 100644 --- a/src/getting-started/testing.md +++ b/src/getting-started/testing.md @@ -47,15 +47,6 @@ for this test to pass. Your test functions should all start with `test`, please documentation](https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods) for more details. -## XCTest limitations in the SwiftWasm toolchain - -As was mentioned in [our section about Swift Foundation](/foundation.md), multi-threading and -file system APIs are currently not available in SwiftWasm. This means that `XCTestExpectation` -and test hooks related to `Bundle` (such as `testBundleWillStart(_:)` and `testBundleDidFinish(_:)`) -are not available in test suites compiled with SwiftWasm. If you have an existing test suite you're -porting to WebAssembly, you should use `#if os(WASI)` directives to exclude places where you use -these APIs from compilation. - ## Building and running the test suite with `SwiftPM` You can build your test suite by running this command in your terminal: