]> git.lizzy.rs Git - rust.git/commitdiff
libcore: ignore tests in Miri instead of removing them entirely
authorRalf Jung <post@ralfj.de>
Sat, 7 Dec 2019 11:38:13 +0000 (12:38 +0100)
committerRalf Jung <post@ralfj.de>
Sat, 7 Dec 2019 11:38:13 +0000 (12:38 +0100)
src/libcore/tests/num/dec2flt/mod.rs
src/libcore/tests/num/flt2dec/mod.rs
src/libcore/tests/num/flt2dec/strategy/dragon.rs
src/libcore/tests/num/flt2dec/strategy/grisu.rs
src/libcore/tests/ptr.rs
src/libcore/tests/slice.rs

index 46eacb4200acc154609d3a6f0aaa945d9d7c2d1a..361758f859e2e03afdd7f3939f4520077abf81f7 100644 (file)
@@ -53,7 +53,7 @@ fn large() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn subnormals() {
     test_literal!(5e-324);
     test_literal!(91e-324);
@@ -65,7 +65,7 @@ fn subnormals() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn infinity() {
     test_literal!(1e400);
     test_literal!(1e309);
index f85369ce40b8db256f8e48e450561ffbc144048a..2f94ea2fc4b70494737f01f8e5eb123fc94805ba 100644 (file)
@@ -256,7 +256,6 @@ pub fn f32_shortest_sanity_test<F>(mut f: F) where F: FnMut(&Decoded, &mut [u8])
     check_shortest!(f(minf32) => b"1", -44);
 }
 
-#[cfg(not(miri))] // Miri is too slow
 pub fn f32_exact_sanity_test<F>(mut f: F)
         where F: FnMut(&Decoded, &mut [u8], i16) -> (usize, i16) {
     let minf32 = ldexp_f32(1.0, -149);
@@ -362,7 +361,6 @@ pub fn f64_shortest_sanity_test<F>(mut f: F) where F: FnMut(&Decoded, &mut [u8])
     check_shortest!(f(minf64) => b"5", -323);
 }
 
-#[cfg(not(miri))] // Miri is too slow
 pub fn f64_exact_sanity_test<F>(mut f: F)
         where F: FnMut(&Decoded, &mut [u8], i16) -> (usize, i16) {
     let minf64 = ldexp_f64(1.0, -1074);
index 0c545b4d88714f3d34f50502fc6720fa611f8657..3d985c6796b16908e96c71ba32f9523f9d622282 100644 (file)
@@ -22,7 +22,7 @@ fn shortest_sanity_test() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn exact_sanity_test() {
     // This test ends up running what I can only assume is some corner-ish case
     // of the `exp2` library function, defined in whatever C runtime we're
index f8bdddfe2e4103e346ad6d5df9f75c044007d87d..a2c7f1b0e83e0e2d8dfd6fac4947342ee4468b82 100644 (file)
@@ -36,7 +36,7 @@ fn shortest_sanity_test() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn exact_sanity_test() {
     // See comments in dragon.rs's exact_sanity_test for why this test is
     // ignored on MSVC
index 1a6be3a9bbd034558618281c4a325e762d1f6ac6..54dbe3004cde68d8c23e0375844c1a78e4e32f0f 100644 (file)
@@ -291,7 +291,7 @@ fn drop(&mut self) {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
+#[cfg_attr(miri, ignore)] // Miri does not compute a maximal `mid` for `align_offset`
 fn align_offset_zst() {
     // For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
     // all, because no amount of elements will align the pointer.
@@ -306,7 +306,7 @@ fn align_offset_zst() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
+#[cfg_attr(miri, ignore)] // Miri does not compute a maximal `mid` for `align_offset`
 fn align_offset_stride1() {
     // For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
     // number of bytes.
@@ -323,7 +323,7 @@ fn align_offset_stride1() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn align_offset_weird_strides() {
     #[repr(packed)]
     struct A3(u16, u8);
index 6609bc3135ae0bfbc64ef0e8684a00b1590b4992..e65d99bbb833e3c23d09af073dc0c2b581831d1d 100644 (file)
@@ -1172,7 +1172,7 @@ fn test_rotate_right() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn brute_force_rotate_test_0() {
     // In case of edge cases involving multiple algorithms
     let n = 300;
@@ -1291,7 +1291,7 @@ fn sort_unstable() {
 
 #[test]
 #[cfg(not(target_arch = "wasm32"))]
-#[cfg(not(miri))] // Miri is too slow
+#[cfg_attr(miri, ignore)] // Miri is too slow
 fn partition_at_index() {
     use core::cmp::Ordering::{Equal, Greater, Less};
     use rand::rngs::StdRng;
@@ -1494,7 +1494,7 @@ fn each_alignment_reversed() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
+#[cfg_attr(miri, ignore)] // Miri does not compute a maximal `mid` for `align_offset`
 fn test_align_to_simple() {
     let bytes = [1u8, 2, 3, 4, 5, 6, 7];
     let (prefix, aligned, suffix) = unsafe { bytes.align_to::<u16>() };
@@ -1518,7 +1518,7 @@ fn test_align_to_zst() {
 }
 
 #[test]
-#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
+#[cfg_attr(miri, ignore)] // Miri does not compute a maximal `mid` for `align_offset`
 fn test_align_to_non_trivial() {
     #[repr(align(8))] struct U64(u64, u64);
     #[repr(align(8))] struct U64U64U32(u64, u64, u32);