Skip to content

Commit 029304e

Browse files
committed
Add codegen check tests
1 parent a7c6251 commit 029304e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ impl Step for CodegenBackend {
323323

324324
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
325325
}
326+
327+
fn metadata(&self) -> Option<StepMetadata> {
328+
Some(StepMetadata::check(self.backend, self.target))
329+
}
326330
}
327331

328332
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,8 @@ mod snapshot {
12431243
[check] std <host>
12441244
[build] llvm <host>
12451245
[check] rustc <host>
1246+
[check] cranelift <host>
1247+
[check] gcc <host>
12461248
");
12471249

12481250
insta::assert_snapshot!(
@@ -1273,6 +1275,8 @@ mod snapshot {
12731275
[build] rustc 0 <host> -> rustc 1 <host>
12741276
[build] rustc 1 <host> -> std 1 <host>
12751277
[check] rustc <host>
1278+
[check] cranelift <host>
1279+
[check] gcc <host>
12761280
");
12771281
}
12781282

@@ -1290,6 +1294,8 @@ mod snapshot {
12901294
[build] rustc 1 <host> -> rustc 2 <host>
12911295
[build] rustc 2 <host> -> std 2 <host>
12921296
[check] rustc <host>
1297+
[check] cranelift <host>
1298+
[check] gcc <host>
12931299
");
12941300
}
12951301

@@ -1420,6 +1426,21 @@ mod snapshot {
14201426
");
14211427
}
14221428

1429+
#[test]
1430+
fn check_codegen() {
1431+
let ctx = TestCtx::new();
1432+
insta::assert_snapshot!(
1433+
ctx.config("check")
1434+
.path("rustc_codegen_cranelift")
1435+
.render_steps(), @r"
1436+
[check] std <host>
1437+
[build] llvm <host>
1438+
[check] rustc <host>
1439+
[check] cranelift <host>
1440+
[check] gcc <host>
1441+
");
1442+
}
1443+
14231444
#[test]
14241445
fn test_exclude() {
14251446
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)