]> git.lizzy.rs Git - rust.git/blob - tests/dogfood.rs
Don't run dogfood on windows or in the rustc test suite
[rust.git] / tests / dogfood.rs
1 #[test]
2 fn dogfood() {
3     if option_env!("RUSTC_TEST_SUITE").is_some() {
4         return;
5     }
6     if cfg!(windows) {
7         return;
8     }
9     let root_dir = std::env::current_dir().unwrap();
10     for d in &[".", "clippy_lints"] {
11         std::env::set_current_dir(root_dir.join(d)).unwrap();
12         let output = std::process::Command::new("cargo")
13             .arg("run")
14             .arg("--bin").arg("cargo-clippy")
15             .arg("--manifest-path").arg(root_dir.join("Cargo.toml"))
16             .output().unwrap();
17         println!("status: {}", output.status);
18         println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
19         println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
20
21         assert!(output.status.success());
22     }
23 }