Auto merge of #869 - RalfJung:tests, r=oli-obk

test suite: be fine with warnings when running on rustc CI

r? @oli-obk
This commit is contained in:
bors 2019-07-31 11:54:00 +00:00
commit 5bbf6733ea

View file

@ -25,9 +25,14 @@ fn rustc_lib_path() -> PathBuf {
}
fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
// Some flags we always want.
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
let in_rustc_test_suite = rustc_test_suite().is_some();
// Add some flags we always want.
flags.push("--edition 2018".to_owned());
if !in_rustc_test_suite {
// Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful.
// (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.)
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
}
if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") {
flags.push(format!("--sysroot {}", sysroot));
}
@ -36,7 +41,7 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
let mut config = compiletest::Config::default().tempdir();
config.mode = mode.parse().expect("Invalid mode");
config.rustc_path = miri_path();
if rustc_test_suite().is_some() {
if in_rustc_test_suite {
config.run_lib_path = rustc_lib_path();
config.compile_lib_path = rustc_lib_path();
}