Skip to content

Commit 2898830

Browse files
committed
Filter tests that need panic unwinding
1 parent 9e62075 commit 2898830

File tree

8 files changed

+18
-0
lines changed

8 files changed

+18
-0
lines changed

rayon-core/src/broadcast/test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ fn spawn_broadcast_mutual_sleepy() {
130130
}
131131

132132
#[test]
133+
#[cfg_attr(not(panic = "unwind"), ignore)]
133134
fn broadcast_panic_one() {
134135
let count = AtomicUsize::new(0);
135136
let pool = ThreadPoolBuilder::new().num_threads(7).build().unwrap();
@@ -146,6 +147,7 @@ fn broadcast_panic_one() {
146147
}
147148

148149
#[test]
150+
#[cfg_attr(not(panic = "unwind"), ignore)]
149151
fn spawn_broadcast_panic_one() {
150152
let (tx, rx) = crossbeam_channel::unbounded();
151153
let (panic_tx, panic_rx) = crossbeam_channel::unbounded();
@@ -166,6 +168,7 @@ fn spawn_broadcast_panic_one() {
166168
}
167169

168170
#[test]
171+
#[cfg_attr(not(panic = "unwind"), ignore)]
169172
fn broadcast_panic_many() {
170173
let count = AtomicUsize::new(0);
171174
let pool = ThreadPoolBuilder::new().num_threads(7).build().unwrap();
@@ -182,6 +185,7 @@ fn broadcast_panic_many() {
182185
}
183186

184187
#[test]
188+
#[cfg_attr(not(panic = "unwind"), ignore)]
185189
fn spawn_broadcast_panic_many() {
186190
let (tx, rx) = crossbeam_channel::unbounded();
187191
let (panic_tx, panic_rx) = crossbeam_channel::unbounded();

rayon-core/src/join/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ fn panic_propagate_both() {
7777
}
7878

7979
#[test]
80+
#[cfg_attr(not(panic = "unwind"), ignore)]
8081
fn panic_b_still_executes() {
8182
let mut x = false;
8283
match unwind::halt_unwinding(|| join(|| panic!("Hello, world!"), || x = true)) {

rayon-core/src/scope/test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ fn panic_propagate_nested_scope_spawn() {
213213
}
214214

215215
#[test]
216+
#[cfg_attr(not(panic = "unwind"), ignore)]
216217
fn panic_propagate_still_execute_1() {
217218
let mut x = false;
218219
match unwind::halt_unwinding(|| {
@@ -227,6 +228,7 @@ fn panic_propagate_still_execute_1() {
227228
}
228229

229230
#[test]
231+
#[cfg_attr(not(panic = "unwind"), ignore)]
230232
fn panic_propagate_still_execute_2() {
231233
let mut x = false;
232234
match unwind::halt_unwinding(|| {
@@ -241,6 +243,7 @@ fn panic_propagate_still_execute_2() {
241243
}
242244

243245
#[test]
246+
#[cfg_attr(not(panic = "unwind"), ignore)]
244247
fn panic_propagate_still_execute_3() {
245248
let mut x = false;
246249
match unwind::halt_unwinding(|| {
@@ -255,6 +258,7 @@ fn panic_propagate_still_execute_3() {
255258
}
256259

257260
#[test]
261+
#[cfg_attr(not(panic = "unwind"), ignore)]
258262
fn panic_propagate_still_execute_4() {
259263
let mut x = false;
260264
match unwind::halt_unwinding(|| {

rayon-core/src/spawn/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn spawn_then_join_outside_worker() {
2323
}
2424

2525
#[test]
26+
#[cfg_attr(not(panic = "unwind"), ignore)]
2627
fn panic_fwd() {
2728
let (tx, rx) = channel();
2829

@@ -80,6 +81,7 @@ fn termination_while_things_are_executing() {
8081
}
8182

8283
#[test]
84+
#[cfg_attr(not(panic = "unwind"), ignore)]
8385
fn custom_panic_handler_and_spawn() {
8486
let (tx, rx) = channel();
8587

@@ -107,6 +109,7 @@ fn custom_panic_handler_and_spawn() {
107109
}
108110

109111
#[test]
112+
#[cfg_attr(not(panic = "unwind"), ignore)]
110113
fn custom_panic_handler_and_nested_spawn() {
111114
let (tx, rx) = channel();
112115

rayon-core/src/thread_pool/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ fn failed_thread_stack() {
115115
}
116116

117117
#[test]
118+
#[cfg_attr(not(panic = "unwind"), ignore)]
118119
fn panic_thread_name() {
119120
let (start_count, start_handler) = count_handler();
120121
let (exit_count, exit_handler) = count_handler();

src/iter/collect/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fn right_produces_items_with_no_complete() {
7676

7777
// Complete is not called by the consumer. Hence,the collection vector is not fully initialized.
7878
#[test]
79+
#[cfg_attr(not(panic = "unwind"), ignore)]
7980
fn produces_items_with_no_complete() {
8081
let counter = DropCounter::default();
8182
let mut v = vec![];
@@ -273,6 +274,7 @@ fn right_panics() {
273274
// The left consumer produces fewer items while the right
274275
// consumer produces correct number; check that created elements are dropped
275276
#[test]
277+
#[cfg_attr(not(panic = "unwind"), ignore)]
276278
fn left_produces_fewer_items_drops() {
277279
let counter = DropCounter::default();
278280
let mut v = vec![];

tests/collect.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::sync::atomic::Ordering;
66
use std::sync::Mutex;
77

88
#[test]
9+
#[cfg_attr(not(panic = "unwind"), ignore)]
910
fn collect_drop_on_unwind() {
1011
struct Recorddrop<'a>(i64, &'a Mutex<Vec<i64>>);
1112

@@ -61,6 +62,7 @@ fn collect_drop_on_unwind() {
6162
}
6263

6364
#[test]
65+
#[cfg_attr(not(panic = "unwind"), ignore)]
6466
fn collect_drop_on_unwind_zst() {
6567
static INSERTS: AtomicUsize = AtomicUsize::new(0);
6668
static DROPS: AtomicUsize = AtomicUsize::new(0);

tests/iter_panic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn iter_panic() {
2020
}
2121

2222
#[test]
23+
#[cfg_attr(not(panic = "unwind"), ignore)]
2324
fn iter_panic_fuse() {
2425
// We only use a single thread in order to make the behavior
2526
// of 'panic_fuse' deterministic

0 commit comments

Comments
 (0)