xref: /openbmc/openbmc/poky/meta/recipes-devtools/rust/files/rust-oe-selftest.patch (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1Add "[ignore]" tags to the failing unit tests to
2ignore them during rust oe-selftest.
3
4Upstream-Status: Inappropriate [OE testing specific]
5
6Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
7---
8diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_errors/src/markdown/tests/term.rs
9--- a/compiler/rustc_errors/src/markdown/tests/term.rs
10+++ b/compiler/rustc_errors/src/markdown/tests/term.rs
11@@ -61,6 +61,7 @@ fn test_wrapping_write() {
12 }
13
14 #[test]
15+#[ignore]
16 fn test_output() {
17     // Capture `--bless` when run via ./x
18     let bless = std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
19diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
20--- a/compiler/rustc_interface/src/tests.rs
21+++ b/compiler/rustc_interface/src/tests.rs
22@@ -137,6 +137,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
23
24 // When the user supplies --test we should implicitly supply --cfg test
25 #[test]
26+#[ignore]
27 fn test_switch_implies_cfg_test() {
28     sess_and_cfg(&["--test"], |_sess, cfg| {
29         assert!(cfg.contains(&(sym::test, None)));
30@@ -145,6 +146,7 @@ fn test_switch_implies_cfg_test() {
31
32 // When the user supplies --test and --cfg test, don't implicitly add another --cfg test
33 #[test]
34+#[ignore]
35 fn test_switch_implies_cfg_test_unless_cfg_test() {
36     sess_and_cfg(&["--test", "--cfg=test"], |_sess, cfg| {
37         let mut test_items = cfg.iter().filter(|&&(name, _)| name == sym::test);
38@@ -154,6 +156,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
39 }
40
41 #[test]
42+#[ignore]
43 fn test_can_print_warnings() {
44     sess_and_cfg(&["-Awarnings"], |sess, _cfg| {
45         assert!(!sess.dcx().can_emit_warnings());
46diff --git a/library/test/src/stats/tests.rs b/library/test/src/stats/tests.rs
47--- a/library/test/src/stats/tests.rs
48+++ b/library/test/src/stats/tests.rs
49@@ -40,6 +40,7 @@
50 }
51
52 #[test]
53+#[ignore]
54 fn test_min_max_nan() {
55     let xs = &[1.0, 2.0, f64::NAN, 3.0, 4.0];
56     let summary = Summary::new(xs);
57diff --git a/library/std/src/io/buffered/tests.rs b/library/std/src/io/buffered/tests.rs
58index 35a5291a347..5f2858d2505 100644
59--- a/library/std/src/io/buffered/tests.rs
60+++ b/library/std/src/io/buffered/tests.rs
61@@ -488,6 +488,7 @@ fn flush(&mut self) -> io::Result<()> {
62 }
63
64 #[test]
65+#[ignore]
66 #[cfg_attr(target_os = "emscripten", ignore)]
67 fn panic_in_write_doesnt_flush_in_drop() {
68     static WRITES: AtomicUsize = AtomicUsize::new(0);
69diff --git a/library/std/src/io/stdio/tests.rs b/library/std/src/io/stdio/tests.rs
70index f89fd27ce6c..79737f5b127 100644
71--- a/library/std/src/io/stdio/tests.rs
72+++ b/library/std/src/io/stdio/tests.rs
73@@ -25,6 +25,7 @@ fn stderrlock_unwind_safe() {
74 fn assert_unwind_safe<T: UnwindSafe + RefUnwindSafe>() {}
75
76 #[test]
77+#[ignore]
78 #[cfg_attr(target_os = "emscripten", ignore)]
79 fn panic_doesnt_poison() {
80     thread::spawn(|| {
81diff --git a/library/std/src/sync/mpsc/sync_tests.rs b/library/std/src/sync/mpsc/sync_tests.rs
82index 945de280f40..1ac7eeabc5c 100644
83--- a/library/std/src/sync/mpsc/sync_tests.rs
84+++ b/library/std/src/sync/mpsc/sync_tests.rs
85@@ -252,6 +252,7 @@ fn oneshot_single_thread_send_port_close() {
86 }
87
88 #[test]
89+#[ignore]
90 fn oneshot_single_thread_recv_chan_close() {
91     // Receiving on a closed chan will panic
92     let res = thread::spawn(move || {
93@@ -347,6 +348,7 @@ fn oneshot_multi_task_recv_then_send() {
94 }
95
96 #[test]
97+#[ignore]
98 fn oneshot_multi_task_recv_then_close() {
99     let (tx, rx) = sync_channel::<Box<i32>>(0);
100     let _t = thread::spawn(move || {
101@@ -371,6 +373,7 @@ fn oneshot_multi_thread_close_stress() {
102 }
103
104 #[test]
105+#[ignore]
106 fn oneshot_multi_thread_send_close_stress() {
107     for _ in 0..stress_factor() {
108         let (tx, rx) = sync_channel::<i32>(0);
109@@ -385,6 +388,7 @@ fn oneshot_multi_thread_send_close_stress() {
110 }
111
112 #[test]
113+#[ignore]
114 fn oneshot_multi_thread_recv_close_stress() {
115     for _ in 0..stress_factor() {
116         let (tx, rx) = sync_channel::<i32>(0);
117diff --git a/library/std/src/sync/mpsc/tests.rs b/library/std/src/sync/mpsc/tests.rs
118index ac1a804cf9c..7c687982324 100644
119--- a/library/std/src/sync/mpsc/tests.rs
120+++ b/library/std/src/sync/mpsc/tests.rs
121@@ -233,6 +233,7 @@ fn oneshot_single_thread_send_port_close() {
122 }
123
124 #[test]
125+#[ignore]
126 fn oneshot_single_thread_recv_chan_close() {
127     // Receiving on a closed chan will panic
128     let res = thread::spawn(move || {
129@@ -313,6 +314,7 @@ fn oneshot_multi_task_recv_then_send() {
130 }
131
132 #[test]
133+#[ignore]
134 fn oneshot_multi_task_recv_then_close() {
135     let (tx, rx) = channel::<Box<i32>>();
136     let _t = thread::spawn(move || {
137@@ -337,6 +339,7 @@ fn oneshot_multi_thread_close_stress() {
138 }
139
140 #[test]
141+#[ignore]
142 fn oneshot_multi_thread_send_close_stress() {
143     for _ in 0..stress_factor() {
144         let (tx, rx) = channel::<i32>();
145@@ -351,6 +354,7 @@ fn oneshot_multi_thread_send_close_stress() {
146 }
147
148 #[test]
149+#[ignore]
150 fn oneshot_multi_thread_recv_close_stress() {
151     for _ in 0..stress_factor() {
152         let (tx, rx) = channel::<i32>();
153diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs
154index 1786a3c09ff..9dcead7092b 100644
155--- a/library/std/src/sync/mutex/tests.rs
156+++ b/library/std/src/sync/mutex/tests.rs
157@@ -82,6 +82,7 @@ fn drop(&mut self) {
158 }
159
160 #[test]
161+#[ignore]
162 fn test_into_inner_poison() {
163     let m = Arc::new(Mutex::new(NonCopy(10)));
164     let m2 = m.clone();
165@@ -106,6 +107,7 @@ fn test_get_mut() {
166 }
167
168 #[test]
169+#[ignore]
170 fn test_get_mut_poison() {
171     let m = Arc::new(Mutex::new(NonCopy(10)));
172     let m2 = m.clone();
173@@ -146,6 +148,7 @@ fn test_mutex_arc_condvar() {
174 }
175
176 #[test]
177+#[ignore]
178 fn test_arc_condvar_poison() {
179     let packet = Packet(Arc::new((Mutex::new(1), Condvar::new())));
180     let packet2 = Packet(packet.0.clone());
181@@ -175,6 +178,7 @@ fn test_arc_condvar_poison() {
182 }
183
184 #[test]
185+#[ignore]
186 fn test_mutex_arc_poison() {
187     let arc = Arc::new(Mutex::new(1));
188     assert!(!arc.is_poisoned());
189@@ -220,6 +220,7 @@ fn test_mutex_arc_nested() {
190 }
191
192 #[test]
193+#[ignore]
194 fn test_mutex_arc_access_in_unwind() {
195     let arc = Arc::new(Mutex::new(1));
196     let arc2 = arc.clone();
197diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs
198index 1a9d3d3f12f..0a9cfc48806 100644
199--- a/library/std/src/sync/rwlock/tests.rs
200+++ b/library/std/src/sync/rwlock/tests.rs
201@@ -47,6 +47,7 @@ fn frob() {
202 }
203
204 #[test]
205+#[ignore]
206 fn test_rw_arc_poison_wr() {
207     let arc = Arc::new(RwLock::new(1));
208     let arc2 = arc.clone();
209@@ -72,6 +73,7 @@ fn test_rw_arc_poison_mapped_w_r() {
210 }
211
212 #[test]
213+#[ignore]
214 fn test_rw_arc_poison_ww() {
215     let arc = Arc::new(RwLock::new(1));
216     assert!(!arc.is_poisoned());
217@@ -100,6 +102,7 @@ fn test_rw_arc_poison_mapped_w_w() {
218 }
219
220 #[test]
221+#[ignore]
222 fn test_rw_arc_no_poison_rr() {
223     let arc = Arc::new(RwLock::new(1));
224     let arc2 = arc.clone();
225@@ -127,6 +130,7 @@ fn test_rw_arc_no_poison_mapped_r_r() {
226 }
227
228 #[test]
229+#[ignore]
230 fn test_rw_arc_no_poison_rw() {
231     let arc = Arc::new(RwLock::new(1));
232     let arc2 = arc.clone();
233@@ -192,6 +196,7 @@ fn test_rw_arc() {
234 }
235
236 #[test]
237+#[ignore]
238 fn test_rw_arc_access_in_unwind() {
239     let arc = Arc::new(RwLock::new(1));
240     let arc2 = arc.clone();
241@@ -275,6 +280,7 @@ fn drop(&mut self) {
242 }
243
244 #[test]
245+#[ignore]
246 fn test_into_inner_poison() {
247     let m = Arc::new(RwLock::new(NonCopy(10)));
248     let m2 = m.clone();
249@@ -299,6 +305,7 @@ fn test_get_mut() {
250 }
251
252 #[test]
253+#[ignore]
254 fn test_get_mut_poison() {
255     let m = Arc::new(RwLock::new(NonCopy(10)));
256     let m2 = m.clone();
257diff --git a/library/std/src/sys/pal/unix/process/process_unix/tests.rs b/library/std/src/sys/pal/unix/process/process_unix/tests.rs
258index 0a6c6ec19fc..bec257bc630 100644
259--- a/library/std/src/sys/pal/unix/process/process_unix/tests.rs
260+++ b/library/std/src/sys/pal/unix/process/process_unix/tests.rs
261@@ -6,6 +6,7 @@
262 // safety etc., are tested in tests/ui/process/process-panic-after-fork.rs
263
264 #[test]
265+#[ignore]
266 fn exitstatus_display_tests() {
267     // In practice this is the same on every Unix.
268     // If some weird platform turns out to be different, and this test fails, use #[cfg].
269@@ -37,6 +38,7 @@
270 }
271
272 #[test]
273+#[ignore]
274 #[cfg_attr(target_os = "emscripten", ignore)]
275 fn test_command_fork_no_unwind() {
276     let got = catch_unwind(|| {
277diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
278index 5d6b9e94ee9..a5aacb2eb87 100644
279--- a/library/std/src/thread/tests.rs
280+++ b/library/std/src/thread/tests.rs
281@@ -116,6 +116,7 @@ fn test_is_finished() {
282 }
283
284 #[test]
285+#[ignore]
286 fn test_join_panic() {
287     match thread::spawn(move || panic!()).join() {
288         result::Result::Err(_) => (),
289@@ -218,6 +219,7 @@ fn test_simple_newsched_spawn() {
290 }
291
292 #[test]
293+#[ignore]
294 fn test_try_panic_message_string_literal() {
295     match thread::spawn(move || {
296         panic!("static string");
297@@ -234,6 +236,7 @@ fn test_try_panic_message_string_literal() {
298 }
299
300 #[test]
301+#[ignore]
302 fn test_try_panic_any_message_owned_str() {
303     match thread::spawn(move || {
304         panic_any("owned string".to_string());
305@@ -250,6 +253,7 @@ fn test_try_panic_any_message_owned_str() {
306 }
307
308 #[test]
309+#[ignore]
310 fn test_try_panic_any_message_any() {
311     match thread::spawn(move || {
312         panic_any(Box::new(413u16) as Box<dyn Any + Send>);
313@@ -268,6 +272,7 @@ fn test_try_panic_any_message_any() {
314 }
315
316 #[test]
317+#[ignore]
318 fn test_try_panic_any_message_unit_struct() {
319     struct Juju;
320
321diff --git a/library/alloc/src/slice/tests.rs b/library/alloc/src/slice/tests.rs
322--- a/library/alloc/src/slice/tests.rs
323+++ b/library/alloc/src/slice/tests.rs
324@@ -186,6 +186,7 @@
325 std::thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false));
326
327 #[test]
328+#[ignore]
329 #[cfg_attr(target_os = "emscripten", ignore)] // no threads
330 #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
331 fn panic_safe() {
332diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
333--- a/library/test/src/tests.rs
334+++ b/library/test/src/tests.rs
335@@ -424,6 +424,7 @@
336 }
337
338 #[test]
339+#[ignore]
340 fn test_time_options_threshold() {
341     let unit = TimeThreshold::new(Duration::from_millis(50), Duration::from_millis(100));
342     let integration = TimeThreshold::new(Duration::from_millis(500), Duration::from_millis(1000));
343diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs
344--- a/library/std/src/sync/mutex/tests.rs
345+++ b/library/std/src/sync/mutex/tests.rs
346@@ -193,6 +193,7 @@
347 }
348
349 #[test]
350+#[ignore]
351 fn test_mutex_arc_poison_mapped() {
352     let arc = Arc::new(Mutex::new(1));
353     assert!(!arc.is_poisoned());
354diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs
355--- a/library/std/src/sync/mutex/tests.rs
356+++ b/library/std/src/sync/mutex/tests.rs
357@@ -272,6 +272,7 @@
358 }
359
360 #[test]
361+#[ignore]
362 fn panic_while_mapping_unlocked_poison() {
363     let lock = Mutex::new(());
364
365diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs
366--- a/library/std/src/sync/rwlock/tests.rs
367+++ b/library/std/src/sync/rwlock/tests.rs
368@@ -59,6 +59,7 @@ fn test_rw_arc_poison_wr() {
369 }
370
371 #[test]
372+#[ignore]
373 fn test_rw_arc_poison_mapped_w_r() {
374     let arc = Arc::new(RwLock::new(1));
375     let arc2 = arc.clone();
376@@ -86,6 +87,7 @@ fn test_rw_arc_poison_ww() {
377 }
378
379 #[test]
380+#[ignore]
381 fn test_rw_arc_poison_mapped_w_w() {
382     let arc = Arc::new(RwLock::new(1));
383     let arc2 = arc.clone();
384@@ -431,6 +433,7 @@ fn panic_while_mapping_read_unlocked_no_poison() {
385 }
386
387 #[test]
388+#[ignore]
389 fn panic_while_mapping_write_unlocked_poison() {
390     let lock = RwLock::new(());
391
392diff --git a/library/core/benches/num/int_log/mod.rs b/library/core/benches/num/int_log/mod.rs
393index 3807cd5d76c..018c5c04456 100644
394--- a/library/core/benches/num/int_log/mod.rs
395+++ b/library/core/benches/num/int_log/mod.rs
396@@ -98,6 +98,7 @@ fn $random_small(bench: &mut Bencher) {
397         }
398
399         #[bench]
400+        #[ignore]
401         fn $geometric(bench: &mut Bencher) {
402             let bases: [$t; 16] = [2, 3, 4, 5, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65];
403             let base_and_numbers: Vec<($t, Vec<$t>)> = bases
404