From 1aa6fb48d621a0b53baf61739c53feb460595e6f Mon Sep 17 00:00:00 2001 From: cospectrum Date: Sun, 5 May 2024 20:16:31 +0300 Subject: [PATCH] Add comments explaining why tests are ignored for Miri runs (#592) --- src/contours.rs | 4 ++-- src/distance_transform.rs | 4 ++-- src/filter/median.rs | 2 +- src/hough.rs | 2 +- src/integral_image.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/contours.rs b/src/contours.rs index 1b6fc484..dcdafb3b 100644 --- a/src/contours.rs +++ b/src/contours.rs @@ -223,7 +223,7 @@ mod tests { assert_eq!(contour.parent, expected_parent); } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn test_contours_structured() { use crate::drawing::draw_polygon_mut; @@ -448,7 +448,7 @@ mod tests { assert_eq!(contours[3].parent, None); } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn get_contours_approx_points() { use crate::drawing::draw_polygon_mut; diff --git a/src/distance_transform.rs b/src/distance_transform.rs index 1a0c08c6..c24f90dc 100644 --- a/src/distance_transform.rs +++ b/src/distance_transform.rs @@ -556,7 +556,7 @@ mod tests { ret } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn test_distance_transform_1d_matches_reference_implementation() { fn prop(f: Vec) -> bool { @@ -596,7 +596,7 @@ mod tests { dists } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn test_euclidean_squared_distance_transform_matches_reference_implementation() { fn prop(image: GrayTestImage) -> TestResult { diff --git a/src/filter/median.rs b/src/filter/median.rs index ce9d5e25..2ebde6eb 100644 --- a/src/filter/median.rs +++ b/src/filter/median.rs @@ -477,7 +477,7 @@ mod tests { sorted[mid] } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn test_median_filter_matches_reference_implementation() { fn prop(image: GrayTestImage, x_radius: u32, y_radius: u32) -> TestResult { diff --git a/src/hough.rs b/src/hough.rs index 2056a736..9412d40f 100644 --- a/src/hough.rs +++ b/src/hough.rs @@ -516,7 +516,7 @@ mod tests { macro_rules! test_detect_line { ($name:ident, $r:expr, $angle:expr) => { - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn $name() { let options = LineDetectionOptions { diff --git a/src/integral_image.rs b/src/integral_image.rs index a01db738..d9f285c1 100644 --- a/src/integral_image.rs +++ b/src/integral_image.rs @@ -580,7 +580,7 @@ mod tests { out } - #[cfg(not(miri))] + #[cfg_attr(miri, ignore = "slow")] #[test] fn test_integral_image_matches_reference_implementation() { fn prop(image: GrayTestImage) -> TestResult {