-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
compiletest: Add a //@ needs-threads
directive
#122109
Conversation
This commit is extracted from rust-lang#122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
8f4f62c
to
75fa9f6
Compare
cc @jieyouxu |
if self.target.starts_with("wasm") { | ||
return self.target.contains("threads"); | ||
} |
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.
For some reason this implementation deeply amuses me. Perhaps because I am also wondering if this will be true by the time wasip3 is a thing?
Well, we can cross that bridge when we come to it.
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.
Heh true! With recent proposals as well I think it's safe to say wasm-and-threads is still an active-design space and it's not clear how it's going to all pan out. Hopefully though this is the "One Place" to modify to get some tests up and running though for the future
@bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#122015 (Add better explanation for `rustc_index::IndexVec`) - rust-lang#122061 (Clarify FatalErrorHandler) - rust-lang#122062 (Explicitly assign constructed C++ classes) - rust-lang#122072 (Refer to "slice" instead of "vector" in Ord and PartialOrd trait impl of slices) - rust-lang#122088 (Remove unnecessary fixme on new thread stack size) - rust-lang#122094 (Remove outdated footnote "missing-stack-probe" in platform-support) - rust-lang#122107 (Temporarily make allow-by-default the `non_local_definitions` lint) - rust-lang#122109 (compiletest: Add a `//@ needs-threads` directive) Failed merges: - rust-lang#122104 (Rust is a proper name: rust → Rust) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122109 - alexcrichton:compiletests-needs-threads, r=workingjubilee compiletest: Add a `//@ needs-threads` directive This commit is extracted from rust-lang#122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
This commit is extracted from #122036 and adds a new directive to the
compiletest
test runner,//@ needs-threads
. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that usesstd::thread
. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of//@ ignore-wasm*
-style ignores into a more self-documenting//@ needs-threads
directive. Additionally thewasm32-wasi-preview1-threads
target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.