Add compiletest check tests

This commit is contained in:
Jakub Beránek 2025-07-02 09:04:09 +02:00
parent 4dfa59dcfb
commit a7c625146e
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
2 changed files with 30 additions and 4 deletions

View file

@ -440,6 +440,10 @@ impl Step for Compiletest {
let _guard = builder.msg_check("compiletest artifacts", self.target, None);
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
}
fn metadata(&self) -> Option<StepMetadata> {
Some(StepMetadata::check("compiletest", self.target))
}
}
macro_rules! tool_check_step {

View file

@ -1249,13 +1249,13 @@ mod snapshot {
ctx.config("check")
.path("rustc")
.render_steps(), @r"
[check] std <host>
[build] llvm <host>
[check] rustc 0 <host> -> rustc 1 <host>
[check] rustc <host>
");
}
#[test]
#[should_panic]
fn check_compiler_stage_0() {
let ctx = TestCtx::new();
ctx.config("check").path("compiler").stage(0).run();
@ -1307,7 +1307,6 @@ mod snapshot {
}
#[test]
#[should_panic]
fn check_library_stage_0() {
let ctx = TestCtx::new();
ctx.config("check").path("library").stage(0).run();
@ -1358,7 +1357,6 @@ mod snapshot {
}
#[test]
#[should_panic]
fn check_miri_stage_0() {
let ctx = TestCtx::new();
ctx.config("check").path("miri").stage(0).run();
@ -1398,6 +1396,30 @@ mod snapshot {
");
}
#[test]
fn check_compiletest() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("check")
.path("compiletest")
.render_steps(), @"[check] compiletest <host>");
}
#[test]
fn check_compiletest_stage1_libtest() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("check")
.path("compiletest")
.args(&["--set", "build.compiletest-use-stage0-libtest=false"])
.render_steps(), @r"
[check] std <host>
[build] llvm <host>
[check] rustc <host>
[check] compiletest <host>
");
}
#[test]
fn test_exclude() {
let ctx = TestCtx::new();