Skip to content

Commit 55b8434

Browse files
committed
Add more tests
1 parent 77eabd3 commit 55b8434

File tree

2 files changed

+83
-9
lines changed

2 files changed

+83
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ macro_rules! lint_any {
444444
}
445445

446446
fn metadata(&self) -> Option<StepMetadata> {
447-
Some(StepMetadata::clippy($readable_name, self.target))
447+
Some(StepMetadata::clippy($readable_name, self.target).built_by(self.build_compiler))
448448
}
449449
}
450450
)+

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

Lines changed: 82 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,12 +1843,11 @@ mod snapshot {
18431843
ctx.config("clippy")
18441844
.path("ci")
18451845
.render_steps(), @r"
1846+
[clippy] rustc 0 <host> -> bootstrap 1 <host>
18461847
[build] llvm <host>
18471848
[build] rustc 0 <host> -> rustc 1 <host>
1848-
[check] rustc 1 <host> -> rustc 2 <host>
18491849
[build] rustc 0 <host> -> clippy-driver 1 <host>
18501850
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1851-
[clippy] bootstrap <host>
18521851
[clippy] rustc 1 <host> -> std 1 <host>
18531852
[clippy] rustc 0 <host> -> rustc 1 <host>
18541853
[clippy] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
@@ -1866,21 +1865,20 @@ mod snapshot {
18661865
[build] llvm <host>
18671866
[build] rustc 0 <host> -> rustc 1 <host>
18681867
[build] rustc 1 <host> -> std 1 <host>
1868+
[build] rustc 0 <host> -> clippy-driver 1 <host>
1869+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1870+
[clippy] rustc 1 <host> -> bootstrap 2 <host>
18691871
[build] rustc 1 <host> -> rustc 2 <host>
1870-
[check] rustc 2 <host> -> rustc 3 <host>
18711872
[build] rustc 1 <host> -> clippy-driver 2 <host>
18721873
[build] rustc 1 <host> -> cargo-clippy 2 <host>
1873-
[clippy] bootstrap <host>
18741874
[clippy] rustc 2 <host> -> std 2 <host>
1875-
[build] rustc 0 <host> -> clippy-driver 1 <host>
1876-
[build] rustc 0 <host> -> cargo-clippy 1 <host>
18771875
[clippy] rustc 1 <host> -> rustc 2 <host>
18781876
[clippy] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
18791877
");
18801878
}
18811879

18821880
#[test]
1883-
fn clippy_compiler() {
1881+
fn clippy_compiler_stage1() {
18841882
let ctx = TestCtx::new();
18851883
insta::assert_snapshot!(
18861884
ctx.config("clippy")
@@ -1892,7 +1890,24 @@ mod snapshot {
18921890
}
18931891

18941892
#[test]
1895-
fn clippy_std() {
1893+
fn clippy_compiler_stage2() {
1894+
let ctx = TestCtx::new();
1895+
insta::assert_snapshot!(
1896+
ctx.config("clippy")
1897+
.path("compiler")
1898+
.stage(2)
1899+
.render_steps(), @r"
1900+
[build] llvm <host>
1901+
[build] rustc 0 <host> -> rustc 1 <host>
1902+
[build] rustc 1 <host> -> std 1 <host>
1903+
[build] rustc 0 <host> -> clippy-driver 1 <host>
1904+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1905+
[clippy] rustc 1 <host> -> rustc 2 <host>
1906+
");
1907+
}
1908+
1909+
#[test]
1910+
fn clippy_std_stage1() {
18961911
let ctx = TestCtx::new();
18971912
insta::assert_snapshot!(
18981913
ctx.config("clippy")
@@ -1905,6 +1920,65 @@ mod snapshot {
19051920
[clippy] rustc 1 <host> -> std 1 <host>
19061921
");
19071922
}
1923+
1924+
#[test]
1925+
fn clippy_std_stage2() {
1926+
let ctx = TestCtx::new();
1927+
insta::assert_snapshot!(
1928+
ctx.config("clippy")
1929+
.path("std")
1930+
.stage(2)
1931+
.render_steps(), @r"
1932+
[build] llvm <host>
1933+
[build] rustc 0 <host> -> rustc 1 <host>
1934+
[build] rustc 1 <host> -> std 1 <host>
1935+
[build] rustc 1 <host> -> rustc 2 <host>
1936+
[build] rustc 1 <host> -> clippy-driver 2 <host>
1937+
[build] rustc 1 <host> -> cargo-clippy 2 <host>
1938+
[clippy] rustc 2 <host> -> std 2 <host>
1939+
");
1940+
}
1941+
1942+
#[test]
1943+
fn clippy_miri_stage1() {
1944+
let ctx = TestCtx::new();
1945+
insta::assert_snapshot!(
1946+
ctx.config("clippy")
1947+
.path("miri")
1948+
.stage(1)
1949+
.render_steps(), @r"
1950+
[build] llvm <host>
1951+
[check] rustc 0 <host> -> rustc 1 <host>
1952+
[clippy] rustc 0 <host> -> miri 1 <host>
1953+
");
1954+
}
1955+
1956+
#[test]
1957+
fn clippy_miri_stage2() {
1958+
let ctx = TestCtx::new();
1959+
insta::assert_snapshot!(
1960+
ctx.config("clippy")
1961+
.path("miri")
1962+
.stage(2)
1963+
.render_steps(), @r"
1964+
[build] llvm <host>
1965+
[build] rustc 0 <host> -> rustc 1 <host>
1966+
[build] rustc 1 <host> -> std 1 <host>
1967+
[check] rustc 1 <host> -> rustc 2 <host>
1968+
[build] rustc 0 <host> -> clippy-driver 1 <host>
1969+
[build] rustc 0 <host> -> cargo-clippy 1 <host>
1970+
[clippy] rustc 1 <host> -> miri 2 <host>
1971+
");
1972+
}
1973+
1974+
#[test]
1975+
fn clippy_bootstrap() {
1976+
let ctx = TestCtx::new();
1977+
insta::assert_snapshot!(
1978+
ctx.config("clippy")
1979+
.path("bootstrap")
1980+
.render_steps(), @"[clippy] rustc 0 <host> -> bootstrap 1 <host>");
1981+
}
19081982
}
19091983

19101984
struct ExecutedSteps {

0 commit comments

Comments
 (0)