From 36070e6c285ecb96fad56470261c66b082685e56 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 11 Nov 2019 09:57:29 +0000 Subject: Generate import tests automatically --- dhall/build.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'dhall/build.rs') diff --git a/dhall/build.rs b/dhall/build.rs index b7ed6ca..c7d339c 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -238,6 +238,48 @@ fn main() -> std::io::Result<()> { }, )?; + make_test_module( + &mut file, + TestFeature { + module_name: "import_success", + directory: spec_tests_dir.join("import/success/"), + variant: "ImportSuccess", + path_filter: |path: &str| { + false + || path == "alternativeEnvNatural" + || path == "alternativeEnvSimple" + || path == "alternativeHashMismatch" + || path == "asLocation" + || path == "asText" + || path == "customHeaders" + || path == "hashFromCache" + || path == "headerForwarding" + || path == "noHeaderForwarding" + }, + input_type: FileType::Text, + output_type: Some(FileType::Text), + }, + )?; + + make_test_module( + &mut file, + TestFeature { + module_name: "import_failure", + directory: spec_tests_dir.join("import/failure/"), + variant: "ImportFailure", + path_filter: |path: &str| { + false + || path == "alternativeEnv" + || path == "alternativeEnvMissing" + || path == "hashMismatch" + || path == "missing" + || path == "referentiallyInsane" + }, + input_type: FileType::Text, + output_type: None, + }, + )?; + make_test_module( &mut file, TestFeature { -- cgit v1.2.3