@@ -1371,6 +1371,7 @@ impl Step for RunMakeSupport {
1371
1371
run. builder . ensure ( RunMakeSupport { compiler, target : run. build_triple ( ) } ) ;
1372
1372
}
1373
1373
1374
+ /// Builds run-make-support and returns the path to the resulting rlib.
1374
1375
fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
1375
1376
builder. ensure ( compile:: Std :: new ( self . compiler , self . target ) ) ;
1376
1377
@@ -1397,6 +1398,53 @@ impl Step for RunMakeSupport {
1397
1398
}
1398
1399
}
1399
1400
1401
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1402
+ pub struct CrateRunMakeSupport {
1403
+ host : TargetSelection ,
1404
+ }
1405
+
1406
+ impl Step for CrateRunMakeSupport {
1407
+ type Output = ( ) ;
1408
+ const ONLY_HOSTS : bool = true ;
1409
+
1410
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1411
+ run. path ( "src/tools/run-make-support" )
1412
+ }
1413
+
1414
+ fn make_run ( run : RunConfig < ' _ > ) {
1415
+ run. builder . ensure ( CrateRunMakeSupport { host : run. target } ) ;
1416
+ }
1417
+
1418
+ /// Runs `cargo test` for run-make-support.
1419
+ fn run ( self , builder : & Builder < ' _ > ) {
1420
+ let host = self . host ;
1421
+ let compiler = builder. compiler ( builder. top_stage , host) ;
1422
+
1423
+ builder. ensure ( compile:: Std :: new ( compiler, host) ) ;
1424
+ let mut cargo = tool:: prepare_tool_cargo (
1425
+ builder,
1426
+ compiler,
1427
+ Mode :: ToolStd ,
1428
+ host,
1429
+ "test" ,
1430
+ "src/tools/run-make-support" ,
1431
+ SourceType :: InTree ,
1432
+ & [ ] ,
1433
+ ) ;
1434
+ cargo. allow_features ( "test" ) ;
1435
+ run_cargo_test (
1436
+ cargo,
1437
+ & [ ] ,
1438
+ & [ ] ,
1439
+ "run-make-support" ,
1440
+ "run-make-support self test" ,
1441
+ compiler,
1442
+ host,
1443
+ builder,
1444
+ ) ;
1445
+ }
1446
+ }
1447
+
1400
1448
default_test ! ( Ui { path: "tests/ui" , mode: "ui" , suite: "ui" } ) ;
1401
1449
1402
1450
default_test ! ( Crashes { path: "tests/crashes" , mode: "crashes" , suite: "crashes" } ) ;
0 commit comments