sysroot_flag is now used for more flags

This commit is contained in:
Oliver Schneider 2016-06-14 11:54:28 +02:00
parent 1bd00e8cb4
commit 8abd293119
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46

View File

@ -15,20 +15,20 @@ fn run_mode(mode: &'static str) {
.expect("need to specify RUST_SYSROOT env var or use rustup or multirust")
.to_owned(),
};
let sysroot_flag = format!("--sysroot {} -Dwarnings", sysroot);
let flags = format!("--sysroot {} -Dwarnings", sysroot);
// FIXME: read directories in sysroot/lib/rustlib and generate the test targets from that
let targets = &["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"];
for &target in targets {
let mut config = compiletest::default_config();
config.host_rustcflags = Some(sysroot_flag.clone());
config.host_rustcflags = Some(flags.clone());
config.mode = mode.parse().expect("Invalid mode");
config.run_lib_path = format!("{}/lib/rustlib/{}/lib", sysroot, target);
config.rustc_path = "target/debug/miri".into();
config.src_base = PathBuf::from(format!("tests/{}", mode));
config.target = target.to_owned();
config.target_rustcflags = Some(sysroot_flag.clone());
config.target_rustcflags = Some(flags.clone());
compiletest::run_tests(&config);
}
}