Skip to content

Commit 535bc1d

Browse files
committed
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
2 parents 6b6580c + a1ecf39 commit 535bc1d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/dogfood.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
#[test]
2-
fn dogfood() {
2+
fn dogfood_clippy() {
3+
// run clippy on itself and fail the test if lint warnings are reported
34
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
45
return;
56
}
67
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
7-
let clippy_cmd = std::path::Path::new(&root_dir)
8+
let clippy_binary = std::path::Path::new(&root_dir)
89
.join("target")
910
.join(env!("PROFILE"))
1011
.join("cargo-clippy");
1112

12-
let output = std::process::Command::new(clippy_cmd)
13+
let output = std::process::Command::new(clippy_binary)
1314
.current_dir(root_dir)
1415
.env("CLIPPY_DOGFOOD", "1")
16+
.env("CARGO_INCREMENTAL", "0")
1517
.arg("clippy-preview")
1618
.arg("--all-targets")
1719
.arg("--all-features")
1820
.arg("--")
1921
.args(&["-D", "clippy::all"])
2022
.args(&["-D", "clippy::internal"])
2123
.args(&["-D", "clippy::pedantic"])
24+
.arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir
2225
.output()
2326
.unwrap();
2427
println!("status: {}", output.status);
@@ -29,12 +32,13 @@ fn dogfood() {
2932
}
3033

3134
#[test]
32-
fn dogfood_tests() {
35+
fn dogfood_subprojects() {
36+
// run clippy on remaining subprojects and fail the test if lint warnings are reported
3337
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
3438
return;
3539
}
3640
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
37-
let clippy_cmd = std::path::Path::new(&root_dir)
41+
let clippy_binary = std::path::Path::new(&root_dir)
3842
.join("target")
3943
.join(env!("PROFILE"))
4044
.join("cargo-clippy");
@@ -47,13 +51,15 @@ fn dogfood_tests() {
4751
"clippy_dev",
4852
"rustc_tools_util",
4953
] {
50-
let output = std::process::Command::new(&clippy_cmd)
54+
let output = std::process::Command::new(&clippy_binary)
5155
.current_dir(root_dir.join(d))
5256
.env("CLIPPY_DOGFOOD", "1")
57+
.env("CARGO_INCREMENTAL", "0")
5358
.arg("clippy")
5459
.arg("--")
5560
.args(&["-D", "clippy::all"])
5661
.args(&["-D", "clippy::pedantic"])
62+
.arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir
5763
.output()
5864
.unwrap();
5965
println!("status: {}", output.status);

0 commit comments

Comments
 (0)