use rustc_version also to parse host in compiletest

This commit is contained in:
Ralf Jung 2018-12-10 13:14:46 +01:00
parent 05f2b2ed3d
commit 5689366a0d

View File

@ -142,17 +142,15 @@ fn get_sysroot() -> PathBuf {
fn get_host() -> String { fn get_host() -> String {
let rustc = rustc_test_suite().unwrap_or(PathBuf::from("rustc")); let rustc = rustc_test_suite().unwrap_or(PathBuf::from("rustc"));
let host = std::process::Command::new(rustc) let rustc_version = std::process::Command::new(rustc)
.arg("-vV") .arg("-vV")
.output() .output()
.expect("rustc not found for -vV") .expect("rustc not found for -vV")
.stdout; .stdout;
let host = std::str::from_utf8(&host).expect("sysroot is not utf8"); let rustc_version = std::str::from_utf8(&rustc_version).expect("rustc -vV is not utf8");
let host = host.split("\nhost: ").nth(1).expect( let version_meta = rustc_version::version_meta_for(&rustc_version)
"no host: part in rustc -vV", .expect("failed to parse rustc version info");
); version_meta.host
let host = host.split('\n').next().expect("no \n after host");
String::from(host)
} }
fn run_pass_miri(opt: bool) { fn run_pass_miri(opt: bool) {