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 {