From 2df5c09242375ca29b7e95ac76de427c4f1518ed Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 26 Aug 2019 20:12:40 +0200 Subject: Tweak tests to avoid double compilation --- dhall/src/tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dhall/src/tests.rs') diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 8f16a12..074818a 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -1,3 +1,6 @@ +#[cfg(not(test))] +use assert_eq as assert_eq_pretty; +#[cfg(test)] use pretty_assertions::assert_eq as assert_eq_pretty; macro_rules! assert_eq_display { @@ -40,6 +43,7 @@ use std::path::PathBuf; use crate::error::{Error, Result}; use crate::phase::Parsed; +#[allow(dead_code)] #[derive(Copy, Clone)] pub enum Feature { Parser, @@ -53,6 +57,7 @@ pub enum Feature { TypeInference, } +#[allow(dead_code)] #[derive(Copy, Clone)] pub enum Status { Success, @@ -63,6 +68,7 @@ fn parse_file_str<'i>(file_path: &str) -> Result { Parsed::parse_file(&PathBuf::from(file_path)) } +#[allow(dead_code)] pub fn run_test_stringy_error( base_path: &str, feature: Feature, @@ -241,6 +247,7 @@ pub fn run_test( Ok(()) } +#[cfg(test)] mod spec { // See build.rs include!(concat!(env!("OUT_DIR"), "/spec_tests.rs")); -- cgit v1.2.3