about summary refs log tree commit diff
path: root/tests/ui/panics
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2024-03-06 12:19:20 -0800
committerAlex Crichton <alex@alexcrichton.com>2024-03-06 12:35:07 -0800
commit75fa9f6decc089ae47beeef1db04aec4ed514bcc (patch)
tree01300bd4ce95b55dc547299ce187908755b02c7b /tests/ui/panics
parentbfe762e0ed2e95041cc12c02c5565c4368f2cc9f (diff)
downloadrust-75fa9f6decc089ae47beeef1db04aec4ed514bcc.tar.gz
rust-75fa9f6decc089ae47beeef1db04aec4ed514bcc.zip
compiletest: Add a `//@ needs-threads` directive
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 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.
Diffstat (limited to 'tests/ui/panics')
-rw-r--r--tests/ui/panics/panic-handler-chain.rs3
-rw-r--r--tests/ui/panics/panic-task-name-none.rs2
-rw-r--r--tests/ui/panics/panic-task-name-owned.rs2
3 files changed, 3 insertions, 4 deletions
diff --git a/tests/ui/panics/panic-handler-chain.rs b/tests/ui/panics/panic-handler-chain.rs
index eb23849f3ac..fea71ad9ec4 100644
--- a/tests/ui/panics/panic-handler-chain.rs
+++ b/tests/ui/panics/panic-handler-chain.rs
@@ -1,9 +1,8 @@
 //@ run-pass
 //@ needs-unwind
+//@ needs-threads
 #![allow(stable_features)]
 
-//@ ignore-emscripten no threads support
-
 #![feature(std_panic)]
 
 use std::sync::atomic::{AtomicUsize, Ordering};
diff --git a/tests/ui/panics/panic-task-name-none.rs b/tests/ui/panics/panic-task-name-none.rs
index 7eb974bde4c..8695771ff5e 100644
--- a/tests/ui/panics/panic-task-name-none.rs
+++ b/tests/ui/panics/panic-task-name-none.rs
@@ -1,7 +1,7 @@
 //@ run-fail
 //@ error-pattern:thread '<unnamed>' panicked
 //@ error-pattern:test
-//@ ignore-emscripten Needs threads
+//@ needs-threads
 
 use std::thread;
 
diff --git a/tests/ui/panics/panic-task-name-owned.rs b/tests/ui/panics/panic-task-name-owned.rs
index 9a680676dc0..42ae33b5d35 100644
--- a/tests/ui/panics/panic-task-name-owned.rs
+++ b/tests/ui/panics/panic-task-name-owned.rs
@@ -1,7 +1,7 @@
 //@ run-fail
 //@ error-pattern:thread 'owned name' panicked
 //@ error-pattern:test
-//@ ignore-emscripten Needs threads.
+//@ needs-threads
 
 use std::thread::Builder;