From 40677a5c47dca8bbf6efda0433c5451b7b429f91 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 2 Aug 2017 18:28:12 +0200 Subject: [PATCH] Choose release miri for release tests --- tests/compiletest.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 7b3ad7d8b78a..0f8865864ce3 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -13,11 +13,16 @@ macro_rules! eprintln { } } +#[cfg(debug_assertions)] +const MIRI_PATH: &str = "target/debug/miri"; +#[cfg(not(debug_assertions))] +const MIRI_PATH: &str = "target/release/miri"; + fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: bool) { eprintln!("## Running compile-fail tests in {} against miri for target {}", path, target); let mut config = compiletest::default_config(); config.mode = "compile-fail".parse().expect("Invalid mode"); - config.rustc_path = "target/debug/miri".into(); + config.rustc_path = MIRI_PATH.into(); if fullmir { if host != target { // skip fullmir on nonhost @@ -56,7 +61,7 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) { config.src_base = PathBuf::from(path); config.target = target.to_owned(); config.host = host.to_owned(); - config.rustc_path = "target/debug/miri".into(); + config.rustc_path = MIRI_PATH.into(); let mut flags = Vec::new(); if fullmir { if host != target {