-
Notifications
You must be signed in to change notification settings - Fork 10.5k
test: fix stdlib tests when targeting WebAssembly/WASI #39519
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
Conversation
@swift-ci please smoke test |
@swift-ci please test Windows platform |
@swift-ci please test Windows platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly does WASI do if a trap is encountered? Can we simply hook the system to observe the trap? This seems like something we should address in the compiler rather than workaround in each of the tests.
@@ -335,6 +337,36 @@ public func evaluateObservationsAllEqual<T : Equatable>(_ observations: [T]) | |||
return .pass | |||
} | |||
|
|||
// WebAssembly/WASI doesn't support multi-threading yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just mark the test as UNSUPPORTED on OS=wasi
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a lit test. Can any test in StdlibUnittest
be marked as UNSUPPORTED
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess compnerd said we can put unsupported statements for each test case, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not sure what you mean here, could you share an example?
according to the spec https://webassembly.github.io/spec/core/intro/overview.html:
This means that traps shut down the whole WebAssembly VM, and it's up to the host environment to restart it or not. But I don't think there's anything that the compiler can do to intercept such trap. |
@swift-ci please test Windows platform |
@swift-ci please smoke test |
@swift-ci please test Windows |
Tests were fully passing on all platforms. When merging I assumed no further objections to be resolved were present, let me know otherwise. |
This change adds support for WASI in stdlib tests. Some tests that expect a crash to happen had to be disabled, since there's currently no way to observe such crash from a WASI host.
Related to SR-9307.