diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-07-02 09:07:28 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2025-07-02 09:18:53 +0200 |
| commit | e6c64df274407ab63f817c5e7712afc289d89a3c (patch) | |
| tree | eb17f103c1fbd94d49bd0b1b9064da9224cc7b9d | |
| parent | 07a1b824429e681cd1cd2e55f6f6ce803ff110d9 (diff) | |
| download | rust-e6c64df274407ab63f817c5e7712afc289d89a3c.tar.gz rust-e6c64df274407ab63f817c5e7712afc289d89a3c.zip | |
Add cross-compilation check tests
| -rw-r--r-- | src/bootstrap/src/core/builder/tests.rs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 1c6c14f47de..a6a147682db 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1300,6 +1300,38 @@ mod snapshot { } #[test] + fn check_cross_compile() { + let ctx = TestCtx::new(); + insta::assert_snapshot!( + ctx.config("check") + .stage(2) + .targets(&[TEST_TRIPLE_1]) + .hosts(&[TEST_TRIPLE_1]) + .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 1 <host> -> std 1 <target1> + [build] rustc 2 <host> -> std 2 <target1> + [check] rustc <target1> + [check] Rustdoc <target1> + [check] cranelift <target1> + [check] gcc <target1> + [check] Clippy <target1> + [check] Miri <target1> + [check] CargoMiri <target1> + [check] MiroptTestTools <target1> + [check] Rustfmt <target1> + [check] rust-analyzer <target1> + [check] TestFloatParse <target1> + [check] FeaturesStatusDump <target1> + [check] std <target1> + "); + } + + #[test] fn check_library_no_explicit_stage() { let ctx = TestCtx::new(); insta::assert_snapshot!( @@ -1349,6 +1381,21 @@ mod snapshot { } #[test] + fn check_library_cross_compile() { + let ctx = TestCtx::new(); + insta::assert_snapshot!( + ctx.config("check") + .paths(&["core", "alloc", "std"]) + .targets(&[TEST_TRIPLE_1, TEST_TRIPLE_2]) + .render_steps(), @r" + [build] llvm <host> + [build] rustc 0 <host> -> rustc 1 <host> + [check] std <target1> + [check] std <target2> + "); + } + + #[test] fn check_miri_no_explicit_stage() { let ctx = TestCtx::new(); insta::assert_snapshot!( |
