Skip to content

Commit 0e97526

Browse files
committed
Add snapshot test for x clippy ci
1 parent 9720bd1 commit 0e97526

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ impl Step for Std {
173173
false,
174174
);
175175
}
176+
177+
fn metadata(&self) -> Option<StepMetadata> {
178+
Some(StepMetadata::clippy("std", self.target))
179+
}
176180
}
177181

178182
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -251,6 +255,10 @@ impl Step for Rustc {
251255
false,
252256
);
253257
}
258+
259+
fn metadata(&self) -> Option<StepMetadata> {
260+
Some(StepMetadata::clippy("rustc", self.target))
261+
}
254262
}
255263

256264
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -401,6 +409,10 @@ macro_rules! lint_any {
401409
false,
402410
);
403411
}
412+
413+
fn metadata(&self) -> Option<StepMetadata> {
414+
Some(StepMetadata::clippy($readable_name, self.target))
415+
}
404416
}
405417
)+
406418
}

src/bootstrap/src/core/builder/tests.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,6 +2065,51 @@ mod snapshot {
20652065
[doc] rustc 1 <host> -> reference (book) 2 <host>
20662066
");
20672067
}
2068+
2069+
#[test]
2070+
fn clippy_ci() {
2071+
let ctx = TestCtx::new();
2072+
insta::assert_snapshot!(
2073+
ctx.config("clippy")
2074+
.path("ci")
2075+
.render_steps(), @r"
2076+
[build] llvm <host>
2077+
[build] rustc 0 <host> -> rustc 1 <host>
2078+
[check] rustc 1 <host> -> rustc 2 <host>
2079+
[build] rustc 0 <host> -> clippy-driver 1 <host>
2080+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
2081+
[clippy] bootstrap <host>
2082+
[clippy] std <host>
2083+
[build] rustc 1 <host> -> std 1 <host>
2084+
[clippy] rustc <host>
2085+
[clippy] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
2086+
");
2087+
}
2088+
2089+
#[test]
2090+
fn clippy_ci_stage_2() {
2091+
let ctx = TestCtx::new();
2092+
insta::assert_snapshot!(
2093+
ctx.config("clippy")
2094+
.path("ci")
2095+
.stage(2)
2096+
.render_steps(), @r"
2097+
[build] llvm <host>
2098+
[build] rustc 0 <host> -> rustc 1 <host>
2099+
[build] rustc 1 <host> -> std 1 <host>
2100+
[build] rustc 1 <host> -> rustc 2 <host>
2101+
[check] rustc 2 <host> -> rustc 3 <host>
2102+
[build] rustc 1 <host> -> clippy-driver 2 <host>
2103+
[build] rustc 1 <host> -> cargo-clippy 2 <host>
2104+
[clippy] bootstrap <host>
2105+
[clippy] std <host>
2106+
[build] rustc 2 <host> -> std 2 <host>
2107+
[clippy] rustc <host>
2108+
[build] rustc 0 <host> -> clippy-driver 1 <host>
2109+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
2110+
[clippy] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
2111+
");
2112+
}
20682113
}
20692114

20702115
struct ExecutedSteps {

0 commit comments

Comments
 (0)