@@ -1248,6 +1248,7 @@ mod staging {
1248
1248
}
1249
1249
1250
1250
#[ test]
1251
+ #[ should_panic]
1251
1252
fn build_compiler_stage_0 ( ) {
1252
1253
insta:: assert_snapshot!( get_steps( "compiler" , "build" , Some ( 0 ) ) , @"" ) ;
1253
1254
}
@@ -1270,6 +1271,97 @@ mod staging {
1270
1271
" ) ;
1271
1272
}
1272
1273
1274
+ #[ test]
1275
+ fn build_library_no_stage ( ) {
1276
+ insta:: assert_snapshot!( get_steps( "library" , "build" , None ) , @r"
1277
+ [build] llvm <target1>
1278
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1279
+ [build] rustc 1 <target1> -> std 1 <target1>
1280
+ " ) ;
1281
+ }
1282
+
1283
+ #[ test]
1284
+ #[ should_panic]
1285
+ fn build_library_stage_0 ( ) {
1286
+ insta:: assert_snapshot!( get_steps( "library" , "build" , Some ( 0 ) ) , @"" ) ;
1287
+ }
1288
+
1289
+ #[ test]
1290
+ fn build_library_stage_1 ( ) {
1291
+ insta:: assert_snapshot!( get_steps( "library" , "build" , Some ( 1 ) ) , @r"
1292
+ [build] llvm <target1>
1293
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1294
+ [build] rustc 1 <target1> -> std 1 <target1>
1295
+ " ) ;
1296
+ }
1297
+
1298
+ #[ test]
1299
+ fn build_library_stage_2 ( ) {
1300
+ insta:: assert_snapshot!( get_steps( "library" , "build" , Some ( 2 ) ) , @r"
1301
+ [build] llvm <target1>
1302
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1303
+ [build] rustc 1 <target1> -> std 1 <target1>
1304
+ [build] rustc 1 <target1> -> rustc 2 <target1>
1305
+ [build] rustc 2 <target1> -> std 2 <target1>
1306
+ " ) ;
1307
+ }
1308
+
1309
+ #[ test]
1310
+ fn build_miri_no_stage ( ) {
1311
+ insta:: assert_snapshot!( get_steps( "miri" , "build" , None ) , @r"
1312
+ [build] llvm <target1>
1313
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1314
+ [build] rustc 1 <target1> -> miri 1 <target1>
1315
+ " ) ;
1316
+ }
1317
+
1318
+ #[ test]
1319
+ #[ should_panic]
1320
+ fn build_miri_stage_0 ( ) {
1321
+ insta:: assert_snapshot!( get_steps( "miri" , "build" , Some ( 0 ) ) , @"" ) ;
1322
+ }
1323
+
1324
+ #[ test]
1325
+ fn build_miri_stage_1 ( ) {
1326
+ insta:: assert_snapshot!( get_steps( "miri" , "build" , Some ( 1 ) ) , @r"
1327
+ [build] llvm <target1>
1328
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1329
+ [build] rustc 1 <target1> -> miri 1 <target1>
1330
+ " ) ;
1331
+ }
1332
+
1333
+ #[ test]
1334
+ fn build_miri_stage_2 ( ) {
1335
+ insta:: assert_snapshot!( get_steps( "miri" , "build" , Some ( 2 ) ) , @r"
1336
+ [build] llvm <target1>
1337
+ [build] rustc 0 <target1> -> rustc 1 <target1>
1338
+ [build] rustc 1 <target1> -> std 1 <target1>
1339
+ [build] rustc 1 <target1> -> rustc 2 <target1>
1340
+ [build] rustc 2 <target1> -> miri 2 <target1>
1341
+ " ) ;
1342
+ }
1343
+
1344
+ #[ test]
1345
+ fn build_bootstrap_tool_no_stage ( ) {
1346
+ insta:: assert_snapshot!( get_steps( "opt-dist" , "build" , None ) , @"[build] rustc 0 <target1> -> opt-dist 0 <target1>" ) ;
1347
+ }
1348
+
1349
+ #[ test]
1350
+ #[ should_panic]
1351
+ fn build_bootstrap_tool_stage_0 ( ) {
1352
+ insta:: assert_snapshot!( get_steps( "opt-dist" , "build" , Some ( 0 ) ) , @"" ) ;
1353
+ }
1354
+
1355
+ #[ test]
1356
+ fn build_bootstrap_tool_stage_1 ( ) {
1357
+ insta:: assert_snapshot!( get_steps( "opt-dist" , "build" , Some ( 1 ) ) , @"[build] rustc 0 <target1> -> opt-dist 0 <target1>" ) ;
1358
+ }
1359
+
1360
+ #[ test]
1361
+ fn build_bootstrap_tool_stage_2 ( ) {
1362
+ insta:: assert_snapshot!( get_steps( "opt-dist" , "build" , Some ( 2 ) ) , @"[build] rustc 0 <target1> -> opt-dist 0 <target1>" ) ;
1363
+ }
1364
+
1273
1365
fn get_steps ( path : & str , kind : & str , stage : Option < u32 > ) -> String {
1274
1366
let mut args = vec ! [ kind, path] ;
1275
1367
let stage_str = stage. map ( |v| v. to_string ( ) ) . unwrap_or_default ( ) ;
@@ -1308,6 +1400,21 @@ fn render_steps(steps: &[(Box<dyn Any>, Box<dyn Any>)]) -> String {
1308
1400
std. compiler. stage,
1309
1401
std. target
1310
1402
) )
1403
+ } else if let Some ( ( miri, output) ) = downcast_step :: < tool:: Miri > ( step, output) {
1404
+ Some ( format ! (
1405
+ "[build] {} -> miri {} <{}>" ,
1406
+ render_compiler( miri. compiler) ,
1407
+ miri. compiler. stage,
1408
+ miri. target
1409
+ ) )
1410
+ } else if let Some ( ( tool, output) ) = downcast_step :: < tool:: OptimizedDist > ( step, output)
1411
+ {
1412
+ Some ( format ! (
1413
+ "[build] {} -> opt-dist {} <{}>" ,
1414
+ render_compiler( tool. compiler) ,
1415
+ tool. compiler. stage,
1416
+ tool. target
1417
+ ) )
1311
1418
} else if let Some ( ( llvm, output) ) = downcast_step :: < llvm:: Llvm > ( step, output) {
1312
1419
Some ( format ! ( "[build] llvm <{}>" , llvm. target) )
1313
1420
} else {
0 commit comments