2017-12-15 09:02:39 +00:00
|
|
|
#[test]
|
|
|
|
fn dogfood() {
|
2018-01-18 21:02:58 +00:00
|
|
|
if option_env!("RUSTC_TEST_SUITE").is_some() {
|
|
|
|
return;
|
|
|
|
}
|
2017-12-15 09:02:39 +00:00
|
|
|
let root_dir = std::env::current_dir().unwrap();
|
|
|
|
for d in &[".", "clippy_lints"] {
|
|
|
|
std::env::set_current_dir(root_dir.join(d)).unwrap();
|
|
|
|
let output = std::process::Command::new("cargo")
|
|
|
|
.arg("run")
|
2018-03-15 15:08:49 +00:00
|
|
|
.arg("--bin")
|
|
|
|
.arg("cargo-clippy")
|
|
|
|
.arg("--manifest-path")
|
|
|
|
.arg(root_dir.join("Cargo.toml"))
|
2018-04-01 07:28:53 +00:00
|
|
|
.env("CLIPPY_DOGFOOD", "true")
|
2018-03-15 15:08:49 +00:00
|
|
|
.output()
|
|
|
|
.unwrap();
|
2017-12-15 09:02:39 +00:00
|
|
|
println!("status: {}", output.status);
|
|
|
|
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
|
|
|
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
|
|
|
|
|
|
|
|
assert!(output.status.success());
|
|
|
|
}
|
|
|
|
}
|