about summary refs log tree commit diff
path: root/src/liballoc/tests
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-04-16 20:04:17 +0200
committerRalf Jung <post@ralfj.de>2019-04-16 20:04:17 +0200
commit9b21324db20593d98164616bd1866787617d35fa (patch)
treefa20df3777739e94a78115fb808b21e11ed3a10a /src/liballoc/tests
parent07133ac70cca85b2f91aedb76a21ece524bc0cb4 (diff)
downloadrust-9b21324db20593d98164616bd1866787617d35fa.tar.gz
rust-9b21324db20593d98164616bd1866787617d35fa.zip
Miri now supports entropy, but is still slow
Diffstat (limited to 'src/liballoc/tests')
-rw-r--r--src/liballoc/tests/binary_heap.rs2
-rw-r--r--src/liballoc/tests/slice.rs21
2 files changed, 16 insertions, 7 deletions
diff --git a/src/liballoc/tests/binary_heap.rs b/src/liballoc/tests/binary_heap.rs
index 0930f8dacd4..0685fa943c0 100644
--- a/src/liballoc/tests/binary_heap.rs
+++ b/src/liballoc/tests/binary_heap.rs
@@ -282,7 +282,7 @@ fn assert_covariance() {
 //
 // Destructors must be called exactly once per element.
 #[test]
-#[cfg(not(miri))] // Miri does not support panics nor entropy
+#[cfg(not(miri))] // Miri does not support catching panics
 fn panic_safe() {
     static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
 
diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs
index b54c128a024..e2bef515419 100644
--- a/src/liballoc/tests/slice.rs
+++ b/src/liballoc/tests/slice.rs
@@ -389,7 +389,7 @@ fn test_reverse() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not support entropy
+#[cfg(not(miri))] // Miri is too slow
 fn test_sort() {
     let mut rng = thread_rng();
 
@@ -466,10 +466,19 @@ fn test_sort() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not support entropy
 fn test_sort_stability() {
-    for len in (2..25).chain(500..510) {
-        for _ in 0..10 {
+    #[cfg(not(miri))] // Miri is too slow
+    let large_limit = 510;
+    #[cfg(not(miri))] // Miri is too slow
+    let rounds = 10;
+
+    #[cfg(miri)]
+    let large_limit = 500; // effectively skips the large tests
+    #[cfg(miri)]
+    let rounds = 1;
+
+    for len in (2..25).chain(500..large_limit) {
+        for _ in 0..rounds {
             let mut counts = [0; 10];
 
             // create a vector like [(6, 1), (5, 1), (6, 2), ...],
@@ -1397,7 +1406,7 @@ 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 threads nor entropy
+#[cfg(not(miri))] // Miri does not support threads
 fn test_box_slice_clone_panics() {
     use std::sync::Arc;
     use std::sync::atomic::{AtomicUsize, Ordering};
@@ -1589,7 +1598,7 @@ 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 threads nor entropy
+#[cfg(not(miri))] // Miri does not support threads
 fn panic_safe() {
     let prev = panic::take_hook();
     panic::set_hook(Box::new(move |info| {