compiletest can just propagate MIRI_SYSROOT from the outside

This commit is contained in:
Ralf Jung 2019-04-07 10:55:34 +02:00
parent 0e4f9634a6
commit 72cd133d1b

View file

@ -87,22 +87,6 @@ fn miri_pass(path: &str, target: &str, opt: bool) {
compiletest::run_tests(&config);
}
/// Ensures that the `MIRI_SYSROOT` env var is set.
fn set_sysroot() {
if std::env::var("MIRI_SYSROOT").is_ok() {
// Nothing to do.
return;
}
let sysroot = std::process::Command::new("rustc")
.arg("--print")
.arg("sysroot")
.output()
.expect("rustc not found")
.stdout;
let sysroot = String::from_utf8(sysroot).expect("sysroot is not utf8");
std::env::set_var("MIRI_SYSROOT", sysroot.trim());
}
fn get_host() -> String {
let rustc = rustc_test_suite().unwrap_or(PathBuf::from("rustc"));
let rustc_version = std::process::Command::new(rustc)
@ -129,8 +113,6 @@ fn compile_fail_miri(opt: bool) {
}
fn test_runner(_tests: &[&()]) {
set_sysroot();
run_pass_miri(false);
run_pass_miri(true);