Skip to content

Commit

Permalink
Rollup merge of rust-lang#63407 - RalfJung:miri-test-sizes, r=Centril
Browse files Browse the repository at this point in the history
reduce some test sizes in Miri
  • Loading branch information
Centril authored Aug 9, 2019
2 parents 14ec32e + 78caca0 commit 4e3c209
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/liballoc/tests/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,10 @@ fn test_split_off_empty_left() {

#[test]
fn test_split_off_large_random_sorted() {
#[cfg(not(miri))] // Miri is too slow
let mut data = rand_data(1529);
#[cfg(miri)]
let mut data = rand_data(529);
// special case with maximum height.
data.sort();

Expand Down
24 changes: 24 additions & 0 deletions src/liballoc/tests/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ fn test_intersection() {
check_intersection(&[11, 1, 3, 77, 103, 5, -5],
&[2, 11, 77, -9, -42, 5, 3],
&[3, 5, 11, 77]);

if cfg!(miri) { // Miri is too slow
return;
}

let large = (0..1000).collect::<Vec<_>>();
check_intersection(&[], &large, &[]);
check_intersection(&large, &[], &[]);
Expand Down Expand Up @@ -98,6 +103,11 @@ fn test_difference() {
check_difference(&[-5, 11, 22, 33, 40, 42],
&[-12, -5, 14, 23, 34, 38, 39, 50],
&[11, 22, 33, 40, 42]);

if cfg!(miri) { // Miri is too slow
return;
}

let large = (0..1000).collect::<Vec<_>>();
check_difference(&[], &large, &[]);
check_difference(&[-1], &large, &[-1]);
Expand Down Expand Up @@ -166,6 +176,17 @@ fn test_is_subset() {
assert_eq!(is_subset(&[1, 2], &[1]), false);
assert_eq!(is_subset(&[1, 2], &[1, 2]), true);
assert_eq!(is_subset(&[1, 2], &[2, 3]), false);
assert_eq!(is_subset(&[-5, 11, 22, 33, 40, 42],
&[-12, -5, 14, 23, 11, 34, 22, 38, 33, 42, 39, 40]),
true);
assert_eq!(is_subset(&[-5, 11, 22, 33, 40, 42],
&[-12, -5, 14, 23, 34, 38, 22, 11]),
false);

if cfg!(miri) { // Miri is too slow
return;
}

let large = (0..1000).collect::<Vec<_>>();
assert_eq!(is_subset(&[], &large), true);
assert_eq!(is_subset(&large, &[]), false);
Expand Down Expand Up @@ -371,7 +392,10 @@ fn test_split_off_empty_left() {

#[test]
fn test_split_off_large_random_sorted() {
#[cfg(not(miri))] // Miri is too slow
let mut data = rand_data(1529);
#[cfg(miri)]
let mut data = rand_data(529);
// special case with maximum height.
data.sort();

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/tests/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ fn test_rotate_right() {
}

#[test]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri is too slow
fn brute_force_rotate_test_0() {
// In case of edge cases involving multiple algorithms
let n = 300;
Expand Down

0 comments on commit 4e3c209

Please sign in to comment.