liballoc: ignore tests in Miri instead of removing them entirely
This commit is contained in:
parent
7ba1232b5e
commit
ca2ffe3a80
9 changed files with 23 additions and 24 deletions
|
@ -22,7 +22,7 @@ fn allocate_zeroed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
#[cfg(not(miri))] // Miri does not support benchmarks
|
#[cfg_attr(miri, ignore)] // Miri does not support benchmarks
|
||||||
fn alloc_owned_small(b: &mut Bencher) {
|
fn alloc_owned_small(b: &mut Bencher) {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let _: Box<_> = box 10;
|
let _: Box<_> = box 10;
|
||||||
|
|
|
@ -182,7 +182,7 @@ fn test_insert_prev() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||||
#[cfg(not(miri))] // Miri does not support threads
|
#[cfg_attr(miri, ignore)] // Miri does not support threads
|
||||||
fn test_send() {
|
fn test_send() {
|
||||||
let n = list_from(&[1, 2, 3]);
|
let n = list_from(&[1, 2, 3]);
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
|
|
|
@ -3,7 +3,7 @@ use super::*;
|
||||||
use ::test;
|
use ::test;
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
#[cfg(not(miri))] // Miri does not support benchmarks
|
#[cfg_attr(miri, ignore)] // Miri does not support benchmarks
|
||||||
fn bench_push_back_100(b: &mut test::Bencher) {
|
fn bench_push_back_100(b: &mut test::Bencher) {
|
||||||
let mut deq = VecDeque::with_capacity(101);
|
let mut deq = VecDeque::with_capacity(101);
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
|
@ -16,7 +16,7 @@ fn bench_push_back_100(b: &mut test::Bencher) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
#[cfg(not(miri))] // Miri does not support benchmarks
|
#[cfg_attr(miri, ignore)] // Miri does not support benchmarks
|
||||||
fn bench_push_front_100(b: &mut test::Bencher) {
|
fn bench_push_front_100(b: &mut test::Bencher) {
|
||||||
let mut deq = VecDeque::with_capacity(101);
|
let mut deq = VecDeque::with_capacity(101);
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
|
@ -29,7 +29,7 @@ fn bench_push_front_100(b: &mut test::Bencher) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
#[cfg(not(miri))] // Miri does not support benchmarks
|
#[cfg_attr(miri, ignore)] // Miri does not support benchmarks
|
||||||
fn bench_pop_back_100(b: &mut test::Bencher) {
|
fn bench_pop_back_100(b: &mut test::Bencher) {
|
||||||
let mut deq = VecDeque::<i32>::with_capacity(101);
|
let mut deq = VecDeque::<i32>::with_capacity(101);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ fn bench_pop_back_100(b: &mut test::Bencher) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
#[cfg(not(miri))] // Miri does not support benchmarks
|
#[cfg_attr(miri, ignore)] // Miri does not support benchmarks
|
||||||
fn bench_pop_front_100(b: &mut test::Bencher) {
|
fn bench_pop_front_100(b: &mut test::Bencher) {
|
||||||
let mut deq = VecDeque::<i32>::with_capacity(101);
|
let mut deq = VecDeque::<i32>::with_capacity(101);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ impl Drop for Canary {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||||
#[cfg(not(miri))] // Miri does not support threads
|
#[cfg_attr(miri, ignore)] // Miri does not support threads
|
||||||
fn manually_share_arc() {
|
fn manually_share_arc() {
|
||||||
let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||||
let arc_v = Arc::new(v);
|
let arc_v = Arc::new(v);
|
||||||
|
@ -334,7 +334,7 @@ fn test_ptr_eq() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||||
#[cfg(not(miri))] // Miri does not support threads
|
#[cfg_attr(miri, ignore)] // Miri does not support threads
|
||||||
fn test_weak_count_locked() {
|
fn test_weak_count_locked() {
|
||||||
let mut a = Arc::new(atomic::AtomicBool::new(false));
|
let mut a = Arc::new(atomic::AtomicBool::new(false));
|
||||||
let a2 = a.clone();
|
let a2 = a.clone();
|
||||||
|
|
|
@ -388,7 +388,7 @@ fn test_reverse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn test_sort() {
|
fn test_sort() {
|
||||||
let mut rng = thread_rng();
|
let mut rng = thread_rng();
|
||||||
|
|
||||||
|
@ -1610,7 +1610,7 @@ fn panic_safe() {
|
||||||
let moduli = &[5, 20, 50];
|
let moduli = &[5, 20, 50];
|
||||||
|
|
||||||
#[cfg(miri)]
|
#[cfg(miri)]
|
||||||
let lens = (1..13);
|
let lens = 1..13;
|
||||||
#[cfg(miri)]
|
#[cfg(miri)]
|
||||||
let moduli = &[10];
|
let moduli = &[10];
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ fn test_join_for_different_lengths_with_long_separator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn test_unsafe_slice() {
|
fn test_unsafe_slice() {
|
||||||
assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
|
assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
|
||||||
assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
|
assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
|
||||||
|
@ -483,8 +483,8 @@ mod slice_index {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(target_os = "emscripten"))] // hits an OOM
|
#[cfg_attr(target_os = "emscripten", ignore)] // hits an OOM
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn simple_big() {
|
fn simple_big() {
|
||||||
fn a_million_letter_x() -> String {
|
fn a_million_letter_x() -> String {
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
|
@ -1069,7 +1069,7 @@ fn test_rev_iterator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn test_chars_decoding() {
|
fn test_chars_decoding() {
|
||||||
let mut bytes = [0; 4];
|
let mut bytes = [0; 4];
|
||||||
for c in (0..0x110000).filter_map(std::char::from_u32) {
|
for c in (0..0x110000).filter_map(std::char::from_u32) {
|
||||||
|
@ -1081,7 +1081,7 @@ fn test_chars_decoding() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn test_chars_rev_decoding() {
|
fn test_chars_rev_decoding() {
|
||||||
let mut bytes = [0; 4];
|
let mut bytes = [0; 4];
|
||||||
for c in (0..0x110000).filter_map(std::char::from_u32) {
|
for c in (0..0x110000).filter_map(std::char::from_u32) {
|
||||||
|
@ -1380,7 +1380,6 @@ fn test_bool_from_str() {
|
||||||
assert_eq!("not even a boolean".parse::<bool>().ok(), None);
|
assert_eq!("not even a boolean".parse::<bool>().ok(), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
|
||||||
fn check_contains_all_substrings(s: &str) {
|
fn check_contains_all_substrings(s: &str) {
|
||||||
assert!(s.contains(""));
|
assert!(s.contains(""));
|
||||||
for i in 0..s.len() {
|
for i in 0..s.len() {
|
||||||
|
@ -1391,7 +1390,7 @@ fn check_contains_all_substrings(s: &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn strslice_issue_16589() {
|
fn strslice_issue_16589() {
|
||||||
assert!("bananas".contains("nana"));
|
assert!("bananas".contains("nana"));
|
||||||
|
|
||||||
|
@ -1408,7 +1407,7 @@ fn strslice_issue_16878() {
|
||||||
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri is too slow
|
#[cfg_attr(miri, ignore)] // Miri is too slow
|
||||||
fn test_strslice_contains() {
|
fn test_strslice_contains() {
|
||||||
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
|
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
|
||||||
check_contains_all_substrings(x);
|
check_contains_all_substrings(x);
|
||||||
|
|
|
@ -523,7 +523,7 @@ fn test_reserve_exact() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve() {
|
fn test_try_reserve() {
|
||||||
|
|
||||||
// These are the interesting cases:
|
// These are the interesting cases:
|
||||||
|
@ -601,7 +601,7 @@ fn test_try_reserve() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve_exact() {
|
fn test_try_reserve_exact() {
|
||||||
|
|
||||||
// This is exactly the same as test_try_reserve with the method changed.
|
// This is exactly the same as test_try_reserve with the method changed.
|
||||||
|
|
|
@ -1080,7 +1080,7 @@ fn test_reserve_exact() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve() {
|
fn test_try_reserve() {
|
||||||
|
|
||||||
// These are the interesting cases:
|
// These are the interesting cases:
|
||||||
|
@ -1183,7 +1183,7 @@ fn test_try_reserve() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve_exact() {
|
fn test_try_reserve_exact() {
|
||||||
|
|
||||||
// This is exactly the same as test_try_reserve with the method changed.
|
// This is exactly the same as test_try_reserve with the method changed.
|
||||||
|
|
|
@ -1100,7 +1100,7 @@ fn test_reserve_exact_2() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve() {
|
fn test_try_reserve() {
|
||||||
// These are the interesting cases:
|
// These are the interesting cases:
|
||||||
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
|
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
|
||||||
|
@ -1214,7 +1214,7 @@ fn test_try_reserve() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri does not support signalling OOM
|
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||||
fn test_try_reserve_exact() {
|
fn test_try_reserve_exact() {
|
||||||
// This is exactly the same as test_try_reserve with the method changed.
|
// This is exactly the same as test_try_reserve with the method changed.
|
||||||
// See that test for comments.
|
// See that test for comments.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue