compiletest: Add a //@ needs-threads directive#122109
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 7, 2024
Merged
Conversation
Collaborator
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
Member
|
cc @jieyouxu |
Comment on lines
+457
to
+459
| if self.target.starts_with("wasm") { | ||
| return self.target.contains("threads"); | ||
| } |
Member
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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
Member
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 7, 2024
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 7, 2024
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is extracted from #122036 and adds a new directive to the
compiletesttest 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-threadsdirective. Additionally thewasm32-wasi-preview1-threadstarget, 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.