Skip to content

Commit a7c6251

Browse files
committed
Add compiletest check tests
1 parent 4dfa59d commit a7c6251

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ impl Step for Compiletest {
440440
let _guard = builder.msg_check("compiletest artifacts", self.target, None);
441441
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
442442
}
443+
444+
fn metadata(&self) -> Option<StepMetadata> {
445+
Some(StepMetadata::check("compiletest", self.target))
446+
}
443447
}
444448

445449
macro_rules! tool_check_step {

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,13 +1249,13 @@ mod snapshot {
12491249
ctx.config("check")
12501250
.path("rustc")
12511251
.render_steps(), @r"
1252+
[check] std <host>
12521253
[build] llvm <host>
1253-
[check] rustc 0 <host> -> rustc 1 <host>
1254+
[check] rustc <host>
12541255
");
12551256
}
12561257

12571258
#[test]
1258-
#[should_panic]
12591259
fn check_compiler_stage_0() {
12601260
let ctx = TestCtx::new();
12611261
ctx.config("check").path("compiler").stage(0).run();
@@ -1307,7 +1307,6 @@ mod snapshot {
13071307
}
13081308

13091309
#[test]
1310-
#[should_panic]
13111310
fn check_library_stage_0() {
13121311
let ctx = TestCtx::new();
13131312
ctx.config("check").path("library").stage(0).run();
@@ -1358,7 +1357,6 @@ mod snapshot {
13581357
}
13591358

13601359
#[test]
1361-
#[should_panic]
13621360
fn check_miri_stage_0() {
13631361
let ctx = TestCtx::new();
13641362
ctx.config("check").path("miri").stage(0).run();
@@ -1398,6 +1396,30 @@ mod snapshot {
13981396
");
13991397
}
14001398

1399+
#[test]
1400+
fn check_compiletest() {
1401+
let ctx = TestCtx::new();
1402+
insta::assert_snapshot!(
1403+
ctx.config("check")
1404+
.path("compiletest")
1405+
.render_steps(), @"[check] compiletest <host>");
1406+
}
1407+
1408+
#[test]
1409+
fn check_compiletest_stage1_libtest() {
1410+
let ctx = TestCtx::new();
1411+
insta::assert_snapshot!(
1412+
ctx.config("check")
1413+
.path("compiletest")
1414+
.args(&["--set", "build.compiletest-use-stage0-libtest=false"])
1415+
.render_steps(), @r"
1416+
[check] std <host>
1417+
[build] llvm <host>
1418+
[check] rustc <host>
1419+
[check] compiletest <host>
1420+
");
1421+
}
1422+
14011423
#[test]
14021424
fn test_exclude() {
14031425
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)