From d2d8ab436021cee48fc61d4d2bb04d2e09159ec6 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 15:32:02 +0100 Subject: test: mark excluded tests as ignored instead of deleting them --- dhall/tests/spec.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'dhall') diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index 77d2aaa..9572d52 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -345,15 +345,7 @@ fn discover_tests_for_feature(feature: TestFeature) -> Vec> { for path in dhall_files_in_dir(&tests_dir, take_ab_suffix, feature.input_type) { - let normalized_path = path.replace("\\", "/"); - if (feature.exclude_path)(&normalized_path) { - continue; - } - if (feature.too_slow_path)(&normalized_path) - && cfg!(debug_assertions) - { - continue; - } + let normalized_rel_path = path.replace("\\", "/"); let path = tests_dir.join(path); let path = path.to_string_lossy(); @@ -371,7 +363,10 @@ fn discover_tests_for_feature(feature: TestFeature) -> Vec> { }; // Transform path into a valid Rust identifier - let name = normalized_path.replace("/", "_").replace("-", "_"); + let name = normalized_rel_path.replace("/", "_").replace("-", "_"); + let excluded = (feature.exclude_path)(&normalized_rel_path); + let too_slow = (feature.too_slow_path)(&normalized_rel_path); + let is_ignored = excluded || (cfg!(debug_assertions) && too_slow); let input = feature .input_type .construct(&format!("{}{}", path, input_suffix)); @@ -382,7 +377,7 @@ fn discover_tests_for_feature(feature: TestFeature) -> Vec> { tests.push(Test { name: format!("{}::{}", feature.module_name, name), kind: "".into(), - is_ignored: false, + is_ignored, is_bench: false, data: SpecTest { input, -- cgit v1.2.3