Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions library/std/tests/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: notify_one,
test_body: {
Expand All @@ -38,7 +38,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: notify_all,
test_body: {
Expand Down Expand Up @@ -79,7 +79,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: test_mutex_arc_condvar,
test_body: {
Expand Down Expand Up @@ -116,7 +116,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_while,
test_body: {
Expand All @@ -141,7 +141,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_timeout_wait,
test_body: {
Expand All @@ -164,7 +164,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_timeout_while_wait,
test_body: {
Expand All @@ -180,7 +180,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_timeout_while_instant_satisfy,
test_body: {
Expand All @@ -197,7 +197,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_timeout_while_wake,
test_body: {
Expand Down Expand Up @@ -226,7 +226,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] // No threads.
nonpoison_and_poison_unwrap_test!(
name: wait_timeout_wake,
test_body: {
Expand Down
3 changes: 3 additions & 0 deletions library/std/tests/sync/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ fn result_unwrap<T, E: std::fmt::Debug>(x: Result<T, E>) -> T {
/// a no-op (the identity function).
///
/// The test names will be prefiex with `poison_` or `nonpoison_`.
///
/// Important: `cfg_attr()` will not apply attributes to both tests.
/// See <https://github.com/rust-lang/rust/pull/146433> for more information.
macro_rules! nonpoison_and_poison_unwrap_test {
(
name: $name:ident,
Expand Down
4 changes: 2 additions & 2 deletions library/std/tests/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
#[cfg(panic = "unwind")] // Requires unwinding support.
nonpoison_and_poison_unwrap_test!(
name: test_panics,
test_body: {
Expand Down Expand Up @@ -297,7 +297,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
#[cfg(panic = "unwind")] // Requires unwinding support.
nonpoison_and_poison_unwrap_test!(
name: test_mutex_arc_access_in_unwind,
test_body: {
Expand Down
8 changes: 4 additions & 4 deletions library/std/tests/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ nonpoison_and_poison_unwrap_test!(
// FIXME: On macOS we use a provenance-incorrect implementation and Miri
// catches that issue with a chance of around 1/1000.
// See <https://github.com/rust-lang/rust/issues/121950> for details.
#[cfg_attr(all(miri, target_os = "macos"), ignore)]
#[cfg(not(all(miri, target_os = "macos")))]
nonpoison_and_poison_unwrap_test!(
name: frob,
test_body: {
Expand Down Expand Up @@ -124,7 +124,7 @@ nonpoison_and_poison_unwrap_test!(
}
);

#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
#[cfg(panic = "unwind")] // Requires unwinding support.
nonpoison_and_poison_unwrap_test!(
name: test_rw_arc_access_in_unwind,
test_body: {
Expand Down Expand Up @@ -315,7 +315,7 @@ nonpoison_and_poison_unwrap_test!(

// FIXME: On macOS we use a provenance-incorrect implementation and Miri catches that issue.
// See <https://github.com/rust-lang/rust/issues/121950> for details.
#[cfg_attr(all(miri, target_os = "macos"), ignore)]
#[cfg(not(all(miri, target_os = "macos")))]
nonpoison_and_poison_unwrap_test!(
name: test_downgrade_observe,
test_body: {
Expand Down Expand Up @@ -362,7 +362,7 @@ nonpoison_and_poison_unwrap_test!(

// FIXME: On macOS we use a provenance-incorrect implementation and Miri catches that issue.
// See <https://github.com/rust-lang/rust/issues/121950> for details.
#[cfg_attr(all(miri, target_os = "macos"), ignore)]
#[cfg(not(all(miri, target_os = "macos")))]
nonpoison_and_poison_unwrap_test!(
name: test_downgrade_atomic,
test_body: {
Expand Down
Loading