diff --git a/geo/tests/jts_tests.rs b/geo/tests/jts_tests.rs index 164f677e4..85dde582c 100644 --- a/geo/tests/jts_tests.rs +++ b/geo/tests/jts_tests.rs @@ -13,7 +13,7 @@ fn init_logging() { fn test_all_general() { init_logging(); - let mut runner = TestRunner::new().with_precision_floating(); + let mut runner = TestRunner::new().with_overlay_precision_floating(); runner.run().expect("test cases failed"); // sanity check that *something* was run diff --git a/jts-test-runner/src/lib.rs b/jts-test-runner/src/lib.rs index 87bfc64e0..becb421b3 100644 --- a/jts-test-runner/src/lib.rs +++ b/jts-test-runner/src/lib.rs @@ -52,14 +52,14 @@ mod tests { // several of the ConvexHull tests are currently failing fn test_all_general() { init_logging(); - let mut runner = TestRunner::new().with_precision_floating(); + let mut runner = TestRunner::new().with_overlay_precision_floating(); runner.run().expect("test cases failed"); // sanity check that the expected number of tests were run. // // We'll need to increase this number as more tests are added, but it should never be // decreased. - let expected_test_count: usize = 227; + let expected_test_count: usize = 274; let actual_test_count = runner.failures().len() + runner.successes().len(); match actual_test_count.cmp(&expected_test_count) { Ordering::Less => { @@ -98,7 +98,7 @@ mod tests { init_logging(); let mut runner = TestRunner::new() .matching_filename_glob("*Overlay*.xml") - .with_precision_floating(); + .with_overlay_precision_floating(); runner.run().expect("test cases failed"); // sanity check that *something* was run diff --git a/jts-test-runner/src/runner.rs b/jts-test-runner/src/runner.rs index 71d3b9e2a..ec5ef545d 100644 --- a/jts-test-runner/src/runner.rs +++ b/jts-test-runner/src/runner.rs @@ -17,7 +17,7 @@ const GENERAL_TEST_XML: Dir = include_dir!("$CARGO_MANIFEST_DIR/resources/testxm pub struct TestRunner { filename_filter: Option, desc_filter: Option, - check_precision: bool, + check_overlay_precision: bool, cases: Option>, failures: Vec, unsupported: Vec, @@ -71,8 +71,8 @@ impl TestRunner { self } - pub fn with_precision_floating(mut self) -> Self { - self.check_precision = true; + pub fn with_overlay_precision_floating(mut self) -> Self { + self.check_overlay_precision = true; self } @@ -513,17 +513,7 @@ impl TestRunner { continue; } }; - if self.check_precision - && run.precision_model.is_some() - && &run.precision_model.as_ref().unwrap().ty != "FLOATING" - { - debug!( - "skipping test input: {:?} with unsupported precision model: {prec:?}", - file.path(), - prec = run.precision_model, - ); - continue; - } + for mut case in run.cases { if let Some(desc_filter) = &self.desc_filter { if case.desc.as_str().contains(desc_filter) { @@ -548,6 +538,18 @@ impl TestRunner { match test.operation_input.into_operation(&case) { Ok(operation) => { + if matches!(operation, Operation::BooleanOp { .. }) + && self.check_overlay_precision + && run.precision_model.is_some() + && &run.precision_model.as_ref().unwrap().ty != "FLOATING" + { + debug!( + "skipping test input: {:?} with unsupported precision model: {prec:?}", + file.path(), + prec = run.precision_model, + ); + continue; + } cases.push(TestCase { description, test_file_name,