about summary refs log tree commit diff
path: root/src/liballoc/tests
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-12-07 12:42:19 +0100
committerRalf Jung <post@ralfj.de>2019-12-07 12:42:19 +0100
commitca2ffe3a8030e0fb6593cb6905a371441a10a4e0 (patch)
tree45b55f5202af5b3582b7f621ac937e1cb8d44dfa /src/liballoc/tests
parent7ba1232b5ea8f6ab011efe2ce3fb97d955342fdb (diff)
downloadrust-ca2ffe3a8030e0fb6593cb6905a371441a10a4e0.tar.gz
rust-ca2ffe3a8030e0fb6593cb6905a371441a10a4e0.zip
liballoc: ignore tests in Miri instead of removing them entirely
Diffstat (limited to 'src/liballoc/tests')
-rw-r--r--src/liballoc/tests/slice.rs4
-rw-r--r--src/liballoc/tests/str.rs15
-rw-r--r--src/liballoc/tests/string.rs4
-rw-r--r--src/liballoc/tests/vec.rs4
-rw-r--r--src/liballoc/tests/vec_deque.rs4
5 files changed, 15 insertions, 16 deletions
diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs
index d9707b95740..ec45de7c79e 100644
--- a/src/liballoc/tests/slice.rs
+++ b/src/liballoc/tests/slice.rs
@@ -388,7 +388,7 @@ fn test_reverse() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_sort() {
     let mut rng = thread_rng();
 
@@ -1610,7 +1610,7 @@ fn panic_safe() {
     let moduli = &[5, 20, 50];
 
     #[cfg(miri)]
-    let lens = (1..13);
+    let lens = 1..13;
     #[cfg(miri)]
     let moduli = &[10];
 
diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs
index cb73c7c179c..1b011242d01 100644
--- a/src/liballoc/tests/str.rs
+++ b/src/liballoc/tests/str.rs
@@ -166,7 +166,7 @@ fn test_join_for_different_lengths_with_long_separator() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_unsafe_slice() {
     assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
     assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
@@ -483,8 +483,8 @@ mod slice_index {
     }
 
     #[test]
-    #[cfg(not(target_os = "emscripten"))] // hits an OOM
-    #[cfg(not(miri))] // Miri is too slow
+    #[cfg_attr(target_os = "emscripten", ignore)] // hits an OOM
+    #[cfg_attr(miri, ignore)] // Miri is too slow
     fn simple_big() {
         fn a_million_letter_x() -> String {
             let mut i = 0;
@@ -1069,7 +1069,7 @@ fn test_rev_iterator() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_chars_decoding() {
     let mut bytes = [0; 4];
     for c in (0..0x110000).filter_map(std::char::from_u32) {
@@ -1081,7 +1081,7 @@ fn test_chars_decoding() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_chars_rev_decoding() {
     let mut bytes = [0; 4];
     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);
 }
 
-#[cfg(not(miri))] // Miri is too slow
 fn check_contains_all_substrings(s: &str) {
     assert!(s.contains(""));
     for i in 0..s.len() {
@@ -1391,7 +1390,7 @@ fn check_contains_all_substrings(s: &str) {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn strslice_issue_16589() {
     assert!("bananas".contains("nana"));
 
@@ -1408,7 +1407,7 @@ fn strslice_issue_16878() {
 
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_strslice_contains() {
     let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
     check_contains_all_substrings(x);
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs
index 55edf56345b..fe7b4ff24b8 100644
--- a/src/liballoc/tests/string.rs
+++ b/src/liballoc/tests/string.rs
@@ -523,7 +523,7 @@ fn test_reserve_exact() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not support signalling OOM
+#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
 fn test_try_reserve() {
 
     // These are the interesting cases:
@@ -601,7 +601,7 @@ fn test_try_reserve() {
 }
 
 #[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() {
 
     // This is exactly the same as test_try_reserve with the method changed.
diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs
index 9ee254f99ac..5e788d61f84 100644
--- a/src/liballoc/tests/vec.rs
+++ b/src/liballoc/tests/vec.rs
@@ -1080,7 +1080,7 @@ fn test_reserve_exact() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not support signalling OOM
+#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
 fn test_try_reserve() {
 
     // These are the interesting cases:
@@ -1183,7 +1183,7 @@ fn test_try_reserve() {
 }
 
 #[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() {
 
     // This is exactly the same as test_try_reserve with the method changed.
diff --git a/src/liballoc/tests/vec_deque.rs b/src/liballoc/tests/vec_deque.rs
index 5a0162a5361..ebcc8320171 100644
--- a/src/liballoc/tests/vec_deque.rs
+++ b/src/liballoc/tests/vec_deque.rs
@@ -1100,7 +1100,7 @@ fn test_reserve_exact_2() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not support signalling OOM
+#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
 fn test_try_reserve() {
     // These are the interesting cases:
     // * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
@@ -1214,7 +1214,7 @@ fn test_try_reserve() {
 }
 
 #[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() {
     // This is exactly the same as test_try_reserve with the method changed.
     // See that test for comments.