diff options
author | Nadrieril | 2019-05-12 18:54:03 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-12 18:54:03 +0200 |
commit | 1274a997c49ae8dcf73ec6a3d1afe96dd03a2ae2 (patch) | |
tree | 943155aba1f56c06e13f691be320b776ff9b93f1 | |
parent | c2b4a2d9b40efbe4f6cb6fd04f6cb90639f4985f (diff) |
Include success or failure prefix in test filtering
Diffstat (limited to '')
-rw-r--r-- | dhall/build.rs | 20 | ||||
-rw-r--r-- | dhall/src/phase/resolve.rs | 4 | ||||
-rw-r--r-- | dhall/src/phase/typecheck.rs | 8 | ||||
-rw-r--r-- | dhall/src/tests.rs | 10 |
4 files changed, 18 insertions, 24 deletions
diff --git a/dhall/build.rs b/dhall/build.rs index ef25d18..3548d33 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -43,22 +43,22 @@ fn make_test_module( ) -> std::io::Result<()> { writeln!(w, "mod {} {{", mod_name)?; for (name, path) in dhall_files_in_dir(&dir.join("success/"), true) { - if exclude(&path) { + if exclude(&("success/".to_owned() + &path)) { continue; } writeln!( w, - r#"make_spec_test!({}, Success, success_{}, "{}");"#, + r#"make_spec_test!({}, Success, success_{}, "success/{}");"#, feature, name, path )?; } for (name, path) in dhall_files_in_dir(&dir.join("failure/"), false) { - if exclude(&path) { + if exclude(&("failure/".to_owned() + &path)) { continue; } writeln!( w, - r#"make_spec_test!({}, Failure, failure_{}, "{}");"#, + r#"make_spec_test!({}, Failure, failure_{}, "failure/{}");"#, feature, name, path )?; } @@ -84,11 +84,11 @@ fn main() -> std::io::Result<()> { "Parser", |path| { // Too slow in debug mode - path == "largeExpression" + path == "success/largeExpression" // Fails binary encoding - || path == "multilet" - || path == "double" - || path == "unit/import/parenthesizeUsing" + || path == "success/multilet" + || path == "success/double" + || path == "success/unit/import/parenthesizeUsing" }, )?; @@ -99,9 +99,9 @@ fn main() -> std::io::Result<()> { "Normalization", |path| { // We don't support bignums - path == "simple/integerToDouble" + path == "success/simple/integerToDouble" // Too slow - || path == "remoteSystems" + || path == "success/remoteSystems" }, )?; diff --git a/dhall/src/phase/resolve.rs b/dhall/src/phase/resolve.rs index fa5f32e..c4d7e5f 100644 --- a/dhall/src/phase/resolve.rs +++ b/dhall/src/phase/resolve.rs @@ -110,13 +110,13 @@ mod spec_tests { macro_rules! import_success { ($name:ident, $path:expr) => { - make_spec_test!(Import, Success, $name, $path); + make_spec_test!(Import, Success, $name, &("success/".to_owned() + $path)); }; } // macro_rules! import_failure { // ($name:ident, $path:expr) => { - // make_spec_test!(Import, Failure, $name, $path); + // make_spec_test!(Import, Failure, $name, &("failure/".to_owned() + $path)); // }; // } diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index ac584cd..bb36060 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -787,23 +787,23 @@ mod spec_tests { macro_rules! tc_success { ($name:ident, $path:expr) => { - make_spec_test!(Typecheck, Success, $name, $path); + make_spec_test!(Typecheck, Success, $name, &("success/".to_owned() + $path)); }; } macro_rules! tc_failure { ($name:ident, $path:expr) => { - make_spec_test!(Typecheck, Failure, $name, $path); + make_spec_test!(Typecheck, Failure, $name, &("failure/".to_owned() + $path)); }; } macro_rules! ti_success { ($name:ident, $path:expr) => { - make_spec_test!(TypeInference, Success, $name, $path); + make_spec_test!(TypeInference, Success, $name, &("success/".to_owned() + $path)); }; } // macro_rules! ti_failure { // ($name:ident, $path:expr) => { - // make_spec_test!(TypeInference, Failure, $name, $path); + // make_spec_test!(TypeInference, Failure, $name, &("failure/".to_owned() + $path)); // }; // } diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index f7802e8..b7a38be 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -86,14 +86,8 @@ pub fn run_test( Typecheck => "typecheck/", TypeInference => "type-inference/", }; - let status_prefix = match status { - Success => "success/", - Failure => "failure/", - }; - let base_path = "../dhall-lang/tests/".to_owned() - + feature_prefix - + status_prefix - + base_path; + let base_path = + "../dhall-lang/tests/".to_owned() + feature_prefix + base_path; match status { Success => { let expr_file_path = base_path.clone() + "A.dhall"; |