From 72cd133d1babc088661d52525e4f3a8a4e5d2d2d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 7 Apr 2019 10:55:34 +0200 Subject: [PATCH] compiletest can just propagate MIRI_SYSROOT from the outside --- tests/compiletest.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 38a9d31d6e8..0ee8ca130ae 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -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); -- 2.44.0