Skip to content

Commit 609d02e

Browse files
deploy: 5e55e67
1 parent c70d3c1 commit 609d02e

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

getting-started/porting.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,18 @@ <h2><a class="header" href="#swift-foundation-and-dispatch" id="swift-foundation
224224
<p>Related functions and properties on other types are also absent or disabled. We would like to make
225225
them available in the future as soon as possible, and <a href="../contribution-guide/index.html">we invite you to
226226
contribute</a> and help us in achieving this goal!</p>
227+
<h2><a class="header" href="#xctest" id="xctest">XCTest</a></h2>
228+
<p><a href="https://github.com/swiftlang/swift-corelibs-xctest">The swift-corelibs-xctest project</a> is available
229+
in WebAssembly platforms, and you can use it to write tests for your SwiftWasm projects.</p>
230+
<p>The following XCTest features are unavailable in SwiftWasm:</p>
231+
<table><thead><tr><th>API</th><th>Status</th></tr></thead><tbody>
232+
<tr><td><code>XCTestExpectation</code></td><td>❌ Unavailable</td></tr>
233+
<tr><td><code>XCTNSPredicateExpectation</code></td><td>❌ Unavailable</td></tr>
234+
<tr><td><code>XCTNSNotificationExpectation</code></td><td>❌ Unavailable</td></tr>
235+
<tr><td><code>XCTWaiter</code></td><td>❌ Unavailable</td></tr>
236+
<tr><td><code>XCTest.perform</code></td><td>❌ Unavailable</td></tr>
237+
<tr><td><code>XCTest.run</code></td><td>❌ Unavailable</td></tr>
238+
</tbody></table>
227239

228240
</main>
229241

getting-started/testing.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ <h2><a class="header" href="#a-simple-test-case" id="a-simple-test-case">A simpl
198198
for this test to pass. Your test functions should all start with <code>test</code>, please see <a href="https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods">XCTest
199199
documentation</a>
200200
for more details.</p>
201-
<h2><a class="header" href="#xctest-limitations-in-the-swiftwasm-toolchain" id="xctest-limitations-in-the-swiftwasm-toolchain">XCTest limitations in the SwiftWasm toolchain</a></h2>
202-
<p>As was mentioned in <a href="/foundation.html">our section about Swift Foundation</a>, multi-threading and
203-
file system APIs are currently not available in SwiftWasm. This means that <code>XCTestExpectation</code>
204-
and test hooks related to <code>Bundle</code> (such as <code>testBundleWillStart(_:)</code> and <code>testBundleDidFinish(_:)</code>)
205-
are not available in test suites compiled with SwiftWasm. If you have an existing test suite you're
206-
porting to WebAssembly, you should use <code>#if os(WASI)</code> directives to exclude places where you use
207-
these APIs from compilation.</p>
208201
<h2><a class="header" href="#building-and-running-the-test-suite-with-swiftpm" id="building-and-running-the-test-suite-with-swiftpm">Building and running the test suite with <code>SwiftPM</code></a></h2>
209202
<p>You can build your test suite by running this command in your terminal:</p>
210203
<pre><code class="language-sh">$ swift build --build-tests --triple wasm32-unknown-wasi

print.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,18 @@ <h2><a class="header" href="#swift-foundation-and-dispatch" id="swift-foundation
428428
<p>Related functions and properties on other types are also absent or disabled. We would like to make
429429
them available in the future as soon as possible, and <a href="getting-started/../contribution-guide/index.html">we invite you to
430430
contribute</a> and help us in achieving this goal!</p>
431+
<h2><a class="header" href="#xctest" id="xctest">XCTest</a></h2>
432+
<p><a href="https://github.com/swiftlang/swift-corelibs-xctest">The swift-corelibs-xctest project</a> is available
433+
in WebAssembly platforms, and you can use it to write tests for your SwiftWasm projects.</p>
434+
<p>The following XCTest features are unavailable in SwiftWasm:</p>
435+
<table><thead><tr><th>API</th><th>Status</th></tr></thead><tbody>
436+
<tr><td><code>XCTestExpectation</code></td><td>❌ Unavailable</td></tr>
437+
<tr><td><code>XCTNSPredicateExpectation</code></td><td>❌ Unavailable</td></tr>
438+
<tr><td><code>XCTNSNotificationExpectation</code></td><td>❌ Unavailable</td></tr>
439+
<tr><td><code>XCTWaiter</code></td><td>❌ Unavailable</td></tr>
440+
<tr><td><code>XCTest.perform</code></td><td>❌ Unavailable</td></tr>
441+
<tr><td><code>XCTest.run</code></td><td>❌ Unavailable</td></tr>
442+
</tbody></table>
431443
<h1><a class="header" href="#creating-a-browser-app" id="creating-a-browser-app">Creating a Browser App</a></h1>
432444
<p>Currently, <a href="https://tokamak.dev">the Tokamak UI framework</a> is one of the easiest ways to build a
433445
browser app with SwiftWasm. It tries to be compatible with <a href="https://developer.apple.com/xcode/swiftui/">the SwiftUI
@@ -630,13 +642,6 @@ <h2><a class="header" href="#a-simple-test-case" id="a-simple-test-case">A simpl
630642
for this test to pass. Your test functions should all start with <code>test</code>, please see <a href="https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods">XCTest
631643
documentation</a>
632644
for more details.</p>
633-
<h2><a class="header" href="#xctest-limitations-in-the-swiftwasm-toolchain" id="xctest-limitations-in-the-swiftwasm-toolchain">XCTest limitations in the SwiftWasm toolchain</a></h2>
634-
<p>As was mentioned in <a href="getting-started//foundation.html">our section about Swift Foundation</a>, multi-threading and
635-
file system APIs are currently not available in SwiftWasm. This means that <code>XCTestExpectation</code>
636-
and test hooks related to <code>Bundle</code> (such as <code>testBundleWillStart(_:)</code> and <code>testBundleDidFinish(_:)</code>)
637-
are not available in test suites compiled with SwiftWasm. If you have an existing test suite you're
638-
porting to WebAssembly, you should use <code>#if os(WASI)</code> directives to exclude places where you use
639-
these APIs from compilation.</p>
640645
<h2><a class="header" href="#building-and-running-the-test-suite-with-swiftpm" id="building-and-running-the-test-suite-with-swiftpm">Building and running the test suite with <code>SwiftPM</code></a></h2>
641646
<p>You can build your test suite by running this command in your terminal:</p>
642647
<pre><code class="language-sh">$ swift build --build-tests --triple wasm32-unknown-wasi

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)