Skip to content

Commit ba27938

Browse files
committed
Add snapshot test for x clippy ci
1 parent d216567 commit ba27938

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
@@ -178,6 +178,10 @@ impl Step for Std {
178178
false,
179179
);
180180
}
181+
182+
fn metadata(&self) -> Option<StepMetadata> {
183+
Some(StepMetadata::clippy("std", self.target))
184+
}
181185
}
182186

183187
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -261,6 +265,10 @@ impl Step for Rustc {
261265
false,
262266
);
263267
}
268+
269+
fn metadata(&self) -> Option<StepMetadata> {
270+
Some(StepMetadata::clippy("rustc", self.target))
271+
}
264272
}
265273

266274
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -404,6 +412,10 @@ macro_rules! lint_any {
404412
false,
405413
);
406414
}
415+
416+
fn metadata(&self) -> Option<StepMetadata> {
417+
Some(StepMetadata::clippy($readable_name, self.target))
418+
}
407419
}
408420
)+
409421
}

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)