Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WASI platform #478

Merged
merged 8 commits into from Mar 13, 2024

Commits on Mar 10, 2024

  1. WebAssembly Support

    WASI does not have thread spawning method yet, but the existing
    implementation blocks threads to wait async test cases synchronously.
    This commit introduced a new waiter method for running async test cases in
    single-threaded WASI environments, enabled by USE_SWIFT_CONCURRENCY_WAITER
    flag.
    
    With the new waiter, `XCTMain` is async runs the given test suites
    without blocking the thread by bypassing some synchronous public APIs
    like `XCTest.perform` and `XCTest.run`. This ignores those APIs even if
    they are overridden by user-defined subclasses, so it's not 100%
    compatible with the existing XCTest APIs. This is a trade-off to
    support async test execution in single-threaded environments, but it
    should be fine because the APIs are seldom overridden by user code.
    kateinoigakukun committed Mar 10, 2024
    Copy the full SHA
    e7ea525 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Guard out awaitUsingExpectation for SWIFT_CONCURRENCY_WAITER mode

    Also this revealed teardown blocks were not being run in the mode, so
    fix that as well.
    kateinoigakukun committed Mar 12, 2024
    Copy the full SHA
    ae2cb67 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    e428651 View commit details
    Browse the repository at this point in the history
  3. Run test suite, setUp, and tearDown in the main actor

    To keep consistency with the regular mode.
    kateinoigakukun committed Mar 12, 2024
    Copy the full SHA
    99a5c70 View commit details
    Browse the repository at this point in the history
  4. Rename USE_SWIFT_CONCURRENCY_WAITER to DISABLE_XCTWAITER

    To make the semantics of the option clearer.
    kateinoigakukun committed Mar 12, 2024
    Copy the full SHA
    c63a84f View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    9decbc4 View commit details
    Browse the repository at this point in the history
  6. Remove DispatchShims.swift and replace it with a conditional typealias

    The use of DispatchQueue in XCTest is now very limited, and it's only used
    in a single place in XCTestCase.swift.
    kateinoigakukun committed Mar 12, 2024
    Copy the full SHA
    2a46822 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    da82bb9 View commit details
    Browse the repository at this point in the history