Add snapshot tests for stage 3 compiler builds

This commit is contained in:
Jakub Beránek 2025-08-19 23:36:43 +02:00
parent 16ad385579
commit 0079da4862
No known key found for this signature in database
GPG key ID: 909CD0D26483516B

View file

@ -672,6 +672,82 @@ mod snapshot {
");
}
#[test]
fn build_compiler_stage_3() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("build")
.path("compiler")
.stage(3)
.render_steps(), @r"
[build] llvm <host>
[build] rustc 0 <host> -> rustc 1 <host>
[build] rustc 1 <host> -> std 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
[build] rustc 2 <host> -> std 2 <host>
[build] rustc 2 <host> -> rustc 3 <host>
");
}
#[test]
fn build_compiler_stage_3_cross() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("build")
.path("compiler")
.hosts(&[TEST_TRIPLE_1])
.stage(3)
.render_steps(), @r"
[build] llvm <host>
[build] llvm <target1>
[build] rustc 0 <host> -> rustc 1 <host>
[build] rustc 1 <host> -> std 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
[build] rustc 1 <host> -> std 1 <target1>
[build] rustc 2 <host> -> std 2 <target1>
[build] rustc 2 <host> -> rustc 3 <target1>
");
}
#[test]
fn build_compiler_stage_3_full_bootstrap() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("build")
.path("compiler")
.stage(3)
.args(&["--set", "build.full-bootstrap=true"])
.render_steps(), @r"
[build] llvm <host>
[build] rustc 0 <host> -> rustc 1 <host>
[build] rustc 1 <host> -> std 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
[build] rustc 2 <host> -> std 2 <host>
[build] rustc 2 <host> -> rustc 3 <host>
");
}
#[test]
fn build_compiler_stage_3_cross_full_bootstrap() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("build")
.path("compiler")
.stage(3)
.hosts(&[TEST_TRIPLE_1])
.args(&["--set", "build.full-bootstrap=true"])
.render_steps(), @r"
[build] llvm <host>
[build] llvm <target1>
[build] rustc 0 <host> -> rustc 1 <host>
[build] rustc 1 <host> -> std 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
[build] rustc 2 <host> -> std 2 <target1>
[build] rustc 2 <host> -> std 2 <host>
[build] rustc 2 <host> -> rustc 3 <target1>
");
}
#[test]
fn build_compiler_codegen_backend() {
let ctx = TestCtx::new();