rust/tests/dogfood.rs
Matthias Krüger 41d3df7321 tests: dogfood: extend to run with --all-features and clippy::internal enabled.
Run it on rustc_tools_util and clippy_dev as well.
2018-09-26 12:32:20 +02:00

27 lines
922 B
Rust

#[test]
fn dogfood() {
if option_env!("RUSTC_TEST_SUITE").is_some() {
return;
}
let root_dir = std::env::current_dir().unwrap();
for d in &[".", "clippy_lints", "rustc_tools_util", "clippy_dev"] {
std::env::set_current_dir(root_dir.join(d)).unwrap();
let output = std::process::Command::new("cargo")
.arg("run")
.arg("--bin")
.arg("cargo-clippy")
.arg("--all-features")
.arg("--manifest-path")
.arg(root_dir.join("Cargo.toml"))
.args(&["--", "-W clippy::internal"])
.env("CLIPPY_DOGFOOD", "true")
.output()
.unwrap();
println!("status: {}", output.status);
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success());
}
}