about summary refs log tree commit diff
path: root/library/std/src/sync/lazy_lock/tests.rs
diff options
context:
space:
mode:
authorNicola Krumschmidt <git@nkcom.de>2024-09-04 02:18:32 +0200
committerNicola Krumschmidt <git@nkcom.de>2024-09-29 04:48:13 +0200
commit87f17f3ccb69e9827562522ae1a38f84d2ba998a (patch)
treed9ca03f59b55b85e2ea912e0bb6d6349305ff3b2 /library/std/src/sync/lazy_lock/tests.rs
parent3b11c82a3d625a01dd5f7b91785374103eb41589 (diff)
downloadrust-87f17f3ccb69e9827562522ae1a38f84d2ba998a.tar.gz
rust-87f17f3ccb69e9827562522ae1a38f84d2ba998a.zip
Fix std tests for wasm32-wasip2 target
Diffstat (limited to 'library/std/src/sync/lazy_lock/tests.rs')
-rw-r--r--library/std/src/sync/lazy_lock/tests.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/sync/lazy_lock/tests.rs b/library/std/src/sync/lazy_lock/tests.rs
index 94044368305..7d7dde54349 100644
--- a/library/std/src/sync/lazy_lock/tests.rs
+++ b/library/std/src/sync/lazy_lock/tests.rs
@@ -34,6 +34,7 @@ fn lazy_default() {
 }
 
 #[test]
+#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
 fn lazy_poisoning() {
     let x: LazyCell<String> = LazyCell::new(|| panic!("kaboom"));
     for _ in 0..2 {
@@ -43,7 +44,7 @@ fn lazy_poisoning() {
 }
 
 #[test]
-#[cfg_attr(target_os = "emscripten", ignore)]
+#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
 fn sync_lazy_new() {
     static CALLED: AtomicUsize = AtomicUsize::new(0);
     static SYNC_LAZY: LazyLock<i32> = LazyLock::new(|| {
@@ -90,7 +91,7 @@ fn sync_lazy_default() {
 }
 
 #[test]
-#[cfg_attr(target_os = "emscripten", ignore)]
+#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
 fn static_sync_lazy() {
     static XS: LazyLock<Vec<i32>> = LazyLock::new(|| {
         let mut xs = Vec::new();
@@ -123,6 +124,7 @@ fn static_sync_lazy_via_fn() {
 }
 
 #[test]
+#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
 fn sync_lazy_poisoning() {
     let x: LazyLock<String> = LazyLock::new(|| panic!("kaboom"));
     for _ in 0..2 {