actually execute miri-pass tests

This commit is contained in:
Oliver Schneider 2016-06-16 10:30:47 +02:00
parent 82dc95c3ad
commit 506f2deaf9
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46

View File

@ -56,16 +56,25 @@ fn compile_test() {
}
let file = file.path();
let stderr = std::io::stderr();
writeln!(stderr.lock(), "test [miri-pass] {}", file.to_str().unwrap()).unwrap();
write!(stderr.lock(), "test [miri-pass] {} ", file.to_str().unwrap()).unwrap();
let mut cmd = std::process::Command::new("target/debug/miri");
cmd.arg(file);
cmd.arg(format!("--sysroot={}", sysroot));
cmd.arg("-Dwarnings");
cmd.arg(format!("-target={}", target));
cmd.arg(format!("--target={}", target));
let libs = Path::new(&sysroot).join("lib");
let sysroot = libs.join("rustlib").join(&target).join("lib");
let paths = std::env::join_paths(&[libs, sysroot]).unwrap();
cmd.env(compiletest::procsrv::dylib_env_var(), paths);
match cmd.output() {
Ok(ref output) if output.status.success() => writeln!(stderr.lock(), "ok").unwrap(),
Ok(output) => {
writeln!(stderr.lock(), "FAILED with exit code {}", output.status.code().unwrap_or(0)).unwrap();
writeln!(stderr.lock(), "stdout: \n {}", std::str::from_utf8(&output.stdout).unwrap()).unwrap();
writeln!(stderr.lock(), "stderr: \n {}", std::str::from_utf8(&output.stderr).unwrap()).unwrap();
}
Err(e) => writeln!(stderr.lock(), "FAILED: {}", e).unwrap(),
}
}
let stderr = std::io::stderr();
writeln!(stderr.lock(), "").unwrap();