about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-08-02 18:28:12 +0200
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-08-02 18:28:12 +0200
commit40677a5c47dca8bbf6efda0433c5451b7b429f91 (patch)
treee00b28e3ee25f9f7dc726010130e94d751916c1b
parent7e585ef1472300f1c76c5966e6bd7d5f56c839d2 (diff)
downloadrust-40677a5c47dca8bbf6efda0433c5451b7b429f91.tar.gz
rust-40677a5c47dca8bbf6efda0433c5451b7b429f91.zip
Choose release miri for release tests
-rw-r--r--tests/compiletest.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/compiletest.rs b/tests/compiletest.rs
index 7b3ad7d8b78..0f8865864ce 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 {