Skip to content

Commit 5dab9c2

Browse files
committed
Add snapshot test for x clippy ci
1 parent c59837d commit 5dab9c2

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
@@ -1835,6 +1835,51 @@ mod snapshot {
18351835
[doc] Compiletest <host>
18361836
");
18371837
}
1838+
1839+
#[test]
1840+
fn clippy_ci() {
1841+
let ctx = TestCtx::new();
1842+
insta::assert_snapshot!(
1843+
ctx.config("clippy")
1844+
.path("ci")
1845+
.render_steps(), @r"
1846+
[build] llvm <host>
1847+
[build] rustc 0 <host> -> rustc 1 <host>
1848+
[check] rustc 1 <host> -> rustc 2 <host>
1849+
[build] rustc 0 <host> -> clippy-driver 1 <host>
1850+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1851+
[clippy] bootstrap <host>
1852+
[clippy] std <host>
1853+
[build] rustc 1 <host> -> std 1 <host>
1854+
[clippy] rustc <host>
1855+
[clippy] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
1856+
");
1857+
}
1858+
1859+
#[test]
1860+
fn clippy_ci_stage_2() {
1861+
let ctx = TestCtx::new();
1862+
insta::assert_snapshot!(
1863+
ctx.config("clippy")
1864+
.path("ci")
1865+
.stage(2)
1866+
.render_steps(), @r"
1867+
[build] llvm <host>
1868+
[build] rustc 0 <host> -> rustc 1 <host>
1869+
[build] rustc 1 <host> -> std 1 <host>
1870+
[build] rustc 1 <host> -> rustc 2 <host>
1871+
[check] rustc 2 <host> -> rustc 3 <host>
1872+
[build] rustc 1 <host> -> clippy-driver 2 <host>
1873+
[build] rustc 1 <host> -> cargo-clippy 2 <host>
1874+
[clippy] bootstrap <host>
1875+
[clippy] std <host>
1876+
[build] rustc 2 <host> -> std 2 <host>
1877+
[clippy] rustc <host>
1878+
[build] rustc 0 <host> -> clippy-driver 1 <host>
1879+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1880+
[clippy] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
1881+
");
1882+
}
18381883
}
18391884

18401885
struct ExecutedSteps {

0 commit comments

Comments
 (0)