summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2020-06-25 15:32:02 +0100
committerNadrieril2020-06-25 16:49:20 +0100
commitd2d8ab436021cee48fc61d4d2bb04d2e09159ec6 (patch)
treec66f2fd81b6a3ffe405079902b0f0eddc6f72c5d
parentb63e00cebff4a8b53c23faac2881fae640da7db2 (diff)
test: mark excluded tests as ignored instead of deleting them
-rw-r--r--dhall/tests/spec.rs17
1 files changed, 6 insertions, 11 deletions
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<Test<SpecTest>> {
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<Test<SpecTest>> {
};
// 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<Test<SpecTest>> {
tests.push(Test {
name: format!("{}::{}", feature.module_name, name),
kind: "".into(),
- is_ignored: false,
+ is_ignored,
is_bench: false,
data: SpecTest {
input,