cargo-miri: allow overwriting miri command, and make that consistent with compiletest

This commit is contained in:
Ralf Jung 2020-05-21 14:24:41 +02:00
parent 35964b10b0
commit ac454a2485
2 changed files with 4 additions and 1 deletions

View File

@ -94,6 +94,9 @@ fn get_arg_flag_value(name: &str) -> Option<String> {
/// Returns the path to the `miri` binary
fn find_miri() -> PathBuf {
if let Some(path) = env::var_os("MIRI") {
return path.into();
}
let mut path = std::env::current_exe().expect("current executable path invalid");
path.set_file_name("miri");
path

View File

@ -9,7 +9,7 @@ use colored::*;
use compiletest_rs as compiletest;
fn miri_path() -> PathBuf {
PathBuf::from(option_env!("MIRI_PATH").unwrap_or(env!("CARGO_BIN_EXE_miri")))
PathBuf::from(option_env!("MIRI").unwrap_or(env!("CARGO_BIN_EXE_miri")))
}
fn run_tests(mode: &str, path: &str, target: &str) {