Skip to content

Commit 5ebe6d3

Browse files
committed
Fix dogfood test
Since clippy cannot be a workspace, we have to check the sub-crates separately
1 parent 26265bb commit 5ebe6d3

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tests/dogfood.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ fn dogfood_clippy() {
2323
.current_dir(root_dir)
2424
.env("CLIPPY_DOGFOOD", "1")
2525
.env("CARGO_INCREMENTAL", "0")
26-
.arg("clippy-preview")
26+
.arg("clippy")
2727
.arg("--all-targets")
2828
.arg("--all-features")
29-
.args(&["-p", "clippy_lints", "-p", "clippy_utils", "-p", "rustc_tools_util"])
3029
.arg("--")
3130
.args(&["-D", "clippy::all"])
3231
.args(&["-D", "clippy::pedantic"])
@@ -125,19 +124,30 @@ fn dogfood_subprojects() {
125124
"clippy_workspace_tests/subcrate",
126125
"clippy_workspace_tests/subcrate/src",
127126
"clippy_dev",
127+
"clippy_lints",
128+
"clippy_utils",
128129
"rustc_tools_util",
129130
] {
130-
let output = Command::new(&*CLIPPY_PATH)
131+
let mut command = Command::new(&*CLIPPY_PATH);
132+
command
131133
.current_dir(root_dir.join(d))
132134
.env("CLIPPY_DOGFOOD", "1")
133135
.env("CARGO_INCREMENTAL", "0")
134136
.arg("clippy")
137+
.arg("--all-targets")
138+
.arg("--all-features")
135139
.arg("--")
136140
.args(&["-D", "clippy::all"])
137141
.args(&["-D", "clippy::pedantic"])
138-
.arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir
139-
.output()
140-
.unwrap();
142+
.arg("-Cdebuginfo=0"); // disable debuginfo to generate less data in the target dir
143+
144+
// internal lints only exist if we build with the internal-lints feature
145+
if cfg!(feature = "internal-lints") {
146+
command.args(&["-D", "clippy::internal"]);
147+
}
148+
149+
let output = command.output().unwrap();
150+
141151
println!("status: {}", output.status);
142152
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
143153
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));

0 commit comments

Comments
 (0)