@@ -1371,6 +1371,7 @@ impl Step for RunMakeSupport {
13711371 run. builder . ensure ( RunMakeSupport { compiler, target : run. build_triple ( ) } ) ;
13721372 }
13731373
1374+ /// Builds run-make-support and returns the path to the resulting rlib.
13741375 fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
13751376 builder. ensure ( compile:: Std :: new ( self . compiler , self . target ) ) ;
13761377
@@ -1397,6 +1398,53 @@ impl Step for RunMakeSupport {
13971398 }
13981399}
13991400
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+
14001448default_test ! ( Ui { path: "tests/ui" , mode: "ui" , suite: "ui" } ) ;
14011449
14021450default_test ! ( Crashes { path: "tests/crashes" , mode: "crashes" , suite: "crashes" } ) ;
0 commit comments