@@ -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,52 @@ impl Step for RunMakeSupport {
13971398 }
13981399}
13991400
1401+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1402+ pub struct RunMakeSupportTest {
1403+ host : TargetSelection ,
1404+ }
1405+
1406+ impl Step for RunMakeSupportTest {
1407+ type Output = ( ) ;
1408+
1409+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1410+ run. path ( "src/tools/run-make-support" )
1411+ }
1412+
1413+ fn make_run ( run : RunConfig < ' _ > ) {
1414+ run. builder . ensure ( RunMakeSupportTest { host : run. target } ) ;
1415+ }
1416+
1417+ /// Runs `cargo test` for run-make-support.
1418+ fn run ( self , builder : & Builder < ' _ > ) {
1419+ let host = self . host ;
1420+ let compiler = builder. compiler ( builder. top_stage , host) ;
1421+
1422+ builder. ensure ( compile:: Std :: new ( compiler, host) ) ;
1423+ let mut cargo = tool:: prepare_tool_cargo (
1424+ builder,
1425+ compiler,
1426+ Mode :: ToolStd ,
1427+ host,
1428+ "test" ,
1429+ "src/tools/run-make-support" ,
1430+ SourceType :: InTree ,
1431+ & [ ] ,
1432+ ) ;
1433+ cargo. allow_features ( "test" ) ;
1434+ run_cargo_test (
1435+ cargo,
1436+ & [ ] ,
1437+ & [ ] ,
1438+ "run-make-support" ,
1439+ "run-make-support self test" ,
1440+ compiler,
1441+ host,
1442+ builder,
1443+ ) ;
1444+ }
1445+ }
1446+
14001447default_test ! ( Ui { path: "tests/ui" , mode: "ui" , suite: "ui" } ) ;
14011448
14021449default_test ! ( Crashes { path: "tests/crashes" , mode: "crashes" , suite: "crashes" } ) ;
0 commit comments