Skip to content

Commit

Permalink
Add comments explaining why tests are ignored for Miri runs (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
cospectrum authored May 5, 2024
1 parent 1f09347 commit 1aa6fb4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/contours.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/distance_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BoundedFloat>) -> bool {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/filter/median.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/hough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/integral_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1aa6fb4

Please sign in to comment.