1 extern crate compiletest_rs as compiletest;
3 use std::path::PathBuf;
5 fn run_mode(mode: &'static str) {
6 let mut config = compiletest::default_config();
7 config.rustc_path = "target/debug/miri".into();
8 let path = std::env::var("RUST_SYSROOT").expect("env variable `RUST_SYSROOT` not set");
9 config.target_rustcflags = Some(format!("--sysroot {}", path));
10 config.host_rustcflags = Some(format!("--sysroot {}", path));
11 let cfg_mode = mode.parse().ok().expect("Invalid mode");
13 config.mode = cfg_mode;
14 config.src_base = PathBuf::from(format!("tests/{}", mode));
16 compiletest::run_tests(&config);
21 run_mode("compile-fail");