Auto merge of #4513 - matthiaskrgr:dogdood_incrcomp, r=llogiq

tests: disable incremental compilation in dogfood to reduce target dir size

tests: execute dogfood tests with incremental compilation disabled reduces target/ dir size of when "cargo test"ing by around 2 gigs.

changelog: none
This commit is contained in:
bors 2019-09-14 16:02:59 +00:00
commit 535bc1d704
1 changed files with 12 additions and 6 deletions

View File

@ -1,17 +1,19 @@
#[test] #[test]
fn dogfood() { fn dogfood_clippy() {
// run clippy on itself and fail the test if lint warnings are reported
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
return; return;
} }
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let clippy_cmd = std::path::Path::new(&root_dir) let clippy_binary = std::path::Path::new(&root_dir)
.join("target") .join("target")
.join(env!("PROFILE")) .join(env!("PROFILE"))
.join("cargo-clippy"); .join("cargo-clippy");
let output = std::process::Command::new(clippy_cmd) let output = std::process::Command::new(clippy_binary)
.current_dir(root_dir) .current_dir(root_dir)
.env("CLIPPY_DOGFOOD", "1") .env("CLIPPY_DOGFOOD", "1")
.env("CARGO_INCREMENTAL", "0")
.arg("clippy-preview") .arg("clippy-preview")
.arg("--all-targets") .arg("--all-targets")
.arg("--all-features") .arg("--all-features")
@ -19,6 +21,7 @@ fn dogfood() {
.args(&["-D", "clippy::all"]) .args(&["-D", "clippy::all"])
.args(&["-D", "clippy::internal"]) .args(&["-D", "clippy::internal"])
.args(&["-D", "clippy::pedantic"]) .args(&["-D", "clippy::pedantic"])
.arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir
.output() .output()
.unwrap(); .unwrap();
println!("status: {}", output.status); println!("status: {}", output.status);
@ -29,12 +32,13 @@ fn dogfood() {
} }
#[test] #[test]
fn dogfood_tests() { fn dogfood_subprojects() {
// run clippy on remaining subprojects and fail the test if lint warnings are reported
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
return; return;
} }
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let clippy_cmd = std::path::Path::new(&root_dir) let clippy_binary = std::path::Path::new(&root_dir)
.join("target") .join("target")
.join(env!("PROFILE")) .join(env!("PROFILE"))
.join("cargo-clippy"); .join("cargo-clippy");
@ -47,13 +51,15 @@ fn dogfood_tests() {
"clippy_dev", "clippy_dev",
"rustc_tools_util", "rustc_tools_util",
] { ] {
let output = std::process::Command::new(&clippy_cmd) let output = std::process::Command::new(&clippy_binary)
.current_dir(root_dir.join(d)) .current_dir(root_dir.join(d))
.env("CLIPPY_DOGFOOD", "1") .env("CLIPPY_DOGFOOD", "1")
.env("CARGO_INCREMENTAL", "0")
.arg("clippy") .arg("clippy")
.arg("--") .arg("--")
.args(&["-D", "clippy::all"]) .args(&["-D", "clippy::all"])
.args(&["-D", "clippy::pedantic"]) .args(&["-D", "clippy::pedantic"])
.arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir
.output() .output()
.unwrap(); .unwrap();
println!("status: {}", output.status); println!("status: {}", output.status);