diff options
| author | Ralf Jung <post@ralfj.de> | 2019-11-22 23:35:56 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-11-22 23:35:56 +0100 |
| commit | 8af2f22985c672bf4cb23b615ac97af00031a2ca (patch) | |
| tree | d158304c56a6975b1bd11cfa1bcbbd6f75764203 /src/liballoc/tests | |
| parent | 3277209af5c3369cbf1786d25cbf48c9a131996b (diff) | |
| download | rust-8af2f22985c672bf4cb23b615ac97af00031a2ca.tar.gz rust-8af2f22985c672bf4cb23b615ac97af00031a2ca.zip | |
enable panic-catching tests in Miri
Diffstat (limited to 'src/liballoc/tests')
| -rw-r--r-- | src/liballoc/tests/slice.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs index 62b33c02cae..6433cbd1842 100644 --- a/src/liballoc/tests/slice.rs +++ b/src/liballoc/tests/slice.rs @@ -1405,7 +1405,6 @@ fn test_box_slice_clone() { #[test] #[allow(unused_must_use)] // here, we care about the side effects of `.clone()` #[cfg_attr(target_os = "emscripten", ignore)] -#[cfg(not(miri))] // Miri does not support catching panics fn test_box_slice_clone_panics() { use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -1595,7 +1594,6 @@ thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false)); #[test] #[cfg_attr(target_os = "emscripten", ignore)] // no threads -#[cfg(not(miri))] // Miri does not support catching panics fn panic_safe() { let prev = panic::take_hook(); panic::set_hook(Box::new(move |info| { @@ -1606,7 +1604,12 @@ fn panic_safe() { let mut rng = thread_rng(); - for len in (1..20).chain(70..MAX_LEN) { + #[cfg(not(miri))] // Miri is too slow + let large_range = 70..MAX_LEN; + #[cfg(miri)] + let large_range = 0..0; // empty range + + for len in (1..20).chain(large_range) { for &modulus in &[5, 20, 50] { for &has_runs in &[false, true] { let mut input = (0..len) |
