Skip to content

Commit e6c64df

Browse files
committed
Add cross-compilation check tests
1 parent 07a1b82 commit e6c64df

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,38 @@ mod snapshot {
12991299
");
13001300
}
13011301

1302+
#[test]
1303+
fn check_cross_compile() {
1304+
let ctx = TestCtx::new();
1305+
insta::assert_snapshot!(
1306+
ctx.config("check")
1307+
.stage(2)
1308+
.targets(&[TEST_TRIPLE_1])
1309+
.hosts(&[TEST_TRIPLE_1])
1310+
.render_steps(), @r"
1311+
[build] llvm <host>
1312+
[build] rustc 0 <host> -> rustc 1 <host>
1313+
[build] rustc 1 <host> -> std 1 <host>
1314+
[build] rustc 1 <host> -> rustc 2 <host>
1315+
[build] rustc 2 <host> -> std 2 <host>
1316+
[build] rustc 1 <host> -> std 1 <target1>
1317+
[build] rustc 2 <host> -> std 2 <target1>
1318+
[check] rustc <target1>
1319+
[check] Rustdoc <target1>
1320+
[check] cranelift <target1>
1321+
[check] gcc <target1>
1322+
[check] Clippy <target1>
1323+
[check] Miri <target1>
1324+
[check] CargoMiri <target1>
1325+
[check] MiroptTestTools <target1>
1326+
[check] Rustfmt <target1>
1327+
[check] rust-analyzer <target1>
1328+
[check] TestFloatParse <target1>
1329+
[check] FeaturesStatusDump <target1>
1330+
[check] std <target1>
1331+
");
1332+
}
1333+
13021334
#[test]
13031335
fn check_library_no_explicit_stage() {
13041336
let ctx = TestCtx::new();
@@ -1348,6 +1380,21 @@ mod snapshot {
13481380
");
13491381
}
13501382

1383+
#[test]
1384+
fn check_library_cross_compile() {
1385+
let ctx = TestCtx::new();
1386+
insta::assert_snapshot!(
1387+
ctx.config("check")
1388+
.paths(&["core", "alloc", "std"])
1389+
.targets(&[TEST_TRIPLE_1, TEST_TRIPLE_2])
1390+
.render_steps(), @r"
1391+
[build] llvm <host>
1392+
[build] rustc 0 <host> -> rustc 1 <host>
1393+
[check] std <target1>
1394+
[check] std <target2>
1395+
");
1396+
}
1397+
13511398
#[test]
13521399
fn check_miri_no_explicit_stage() {
13531400
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)