2 use std::process::{Command, Output};
4 fn run_miri(file: &str, sysroot: &str) -> Output {
6 .args(&["run", "--", "--sysroot", sysroot, file])
8 .unwrap_or_else(|e| panic!("failed to execute process: {}", e))
13 let sysroot = env::var("RUST_SYSROOT").expect("env variable `RUST_SYSROOT` not set");
15 let test_files = fs::read_dir("./tests/run-pass/")
16 .expect("Can't read `run-pass` directory")
17 .filter_map(|entry| entry.ok())
24 .filter_map(|entry| entry.path().to_str().map(|x| x.to_string()));
26 for file in test_files {
27 println!("{}: compile test running", file);
29 let test_run = run_miri(&file, &sysroot);
31 if test_run.status.code().unwrap_or(-1) != 0 {
32 println!("{}: error {:?}", file, test_run);
34 println!("{}: ok", file);