@@ -55,73 +55,54 @@ fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool {
5555}
5656
5757#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
58- pub struct CrateJsonDocLint {
58+ pub struct CrateBootstrap {
59+ path : Interned < PathBuf > ,
5960 host : TargetSelection ,
6061}
6162
62- impl Step for CrateJsonDocLint {
63+ impl Step for CrateBootstrap {
6364 type Output = ( ) ;
6465 const ONLY_HOSTS : bool = true ;
6566 const DEFAULT : bool = true ;
6667
6768 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
6869 run. path ( "src/tools/jsondoclint" )
70+ . path ( "src/tools/suggest-tests" )
71+ . path ( "src/tools/replace-version-placeholder" )
72+ . alias ( "tidyselftest" )
6973 }
7074
7175 fn make_run ( run : RunConfig < ' _ > ) {
72- run. builder . ensure ( CrateJsonDocLint { host : run. target } ) ;
76+ for path in run. paths {
77+ let path = INTERNER . intern_path ( path. assert_single_path ( ) . path . clone ( ) ) ;
78+ run. builder . ensure ( CrateBootstrap { host : run. target , path } ) ;
79+ }
7380 }
7481
7582 fn run ( self , builder : & Builder < ' _ > ) {
7683 let bootstrap_host = builder. config . build ;
7784 let compiler = builder. compiler ( 0 , bootstrap_host) ;
85+ let mut path = self . path . to_str ( ) . unwrap ( ) ;
86+ if path == "tidyselftest" {
87+ path = "src/tools/tidy" ;
88+ }
7889
7990 let cargo = tool:: prepare_tool_cargo (
8091 builder,
8192 compiler,
8293 Mode :: ToolBootstrap ,
8394 bootstrap_host,
8495 "test" ,
85- "src/tools/jsondoclint" ,
96+ path ,
8697 SourceType :: InTree ,
8798 & [ ] ,
8899 ) ;
89- run_cargo_test ( cargo, & [ ] , & [ ] , compiler, bootstrap_host, builder) ;
90- }
91- }
92-
93- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
94- pub struct SuggestTestsCrate {
95- host : TargetSelection ,
96- }
97-
98- impl Step for SuggestTestsCrate {
99- type Output = ( ) ;
100- const ONLY_HOSTS : bool = true ;
101- const DEFAULT : bool = true ;
102-
103- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
104- run. path ( "src/tools/suggest-tests" )
105- }
106-
107- fn make_run ( run : RunConfig < ' _ > ) {
108- run. builder . ensure ( SuggestTestsCrate { host : run. target } ) ;
109- }
110-
111- fn run ( self , builder : & Builder < ' _ > ) {
112- let bootstrap_host = builder. config . build ;
113- let compiler = builder. compiler ( 0 , bootstrap_host) ;
114-
115- let cargo = tool:: prepare_tool_cargo (
116- builder,
117- compiler,
118- Mode :: ToolBootstrap ,
100+ builder. info ( & format ! (
101+ "{} {} stage0 ({})" ,
102+ builder. kind. test_description( ) ,
103+ path,
119104 bootstrap_host,
120- "test" ,
121- "src/tools/suggest-tests" ,
122- SourceType :: InTree ,
123- & [ ] ,
124- ) ;
105+ ) ) ;
125106 run_cargo_test ( cargo, & [ ] , & [ ] , compiler, bootstrap_host, builder) ;
126107 }
127108}
@@ -1147,40 +1128,6 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
11471128 }
11481129}
11491130
1150- /// Runs tidy's own tests.
1151- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1152- pub struct TidySelfTest ;
1153-
1154- impl Step for TidySelfTest {
1155- type Output = ( ) ;
1156- const DEFAULT : bool = true ;
1157- const ONLY_HOSTS : bool = true ;
1158-
1159- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1160- run. alias ( "tidyselftest" )
1161- }
1162-
1163- fn make_run ( run : RunConfig < ' _ > ) {
1164- run. builder . ensure ( TidySelfTest ) ;
1165- }
1166-
1167- fn run ( self , builder : & Builder < ' _ > ) {
1168- let bootstrap_host = builder. config . build ;
1169- let compiler = builder. compiler ( 0 , bootstrap_host) ;
1170- let cargo = tool:: prepare_tool_cargo (
1171- builder,
1172- compiler,
1173- Mode :: ToolBootstrap ,
1174- bootstrap_host,
1175- "test" ,
1176- "src/tools/tidy" ,
1177- SourceType :: InTree ,
1178- & [ ] ,
1179- ) ;
1180- run_cargo_test ( cargo, & [ ] , & [ ] , compiler, bootstrap_host, builder) ;
1181- }
1182- }
1183-
11841131#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
11851132pub struct ExpandYamlAnchors ;
11861133
@@ -2614,43 +2561,6 @@ impl Step for TierCheck {
26142561 }
26152562}
26162563
2617- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
2618- pub struct ReplacePlaceholderTest ;
2619-
2620- impl Step for ReplacePlaceholderTest {
2621- type Output = ( ) ;
2622- const ONLY_HOSTS : bool = true ;
2623- const DEFAULT : bool = true ;
2624-
2625- /// Ensure the version placeholder replacement tool builds
2626- fn run ( self , builder : & Builder < ' _ > ) {
2627- builder. info ( "build check for version replacement placeholder" ) ;
2628-
2629- // Test the version placeholder replacement tool itself.
2630- let bootstrap_host = builder. config . build ;
2631- let compiler = builder. compiler ( 0 , bootstrap_host) ;
2632- let cargo = tool:: prepare_tool_cargo (
2633- builder,
2634- compiler,
2635- Mode :: ToolBootstrap ,
2636- bootstrap_host,
2637- "test" ,
2638- "src/tools/replace-version-placeholder" ,
2639- SourceType :: InTree ,
2640- & [ ] ,
2641- ) ;
2642- add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
2643- }
2644-
2645- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
2646- run. path ( "src/tools/replace-version-placeholder" )
2647- }
2648-
2649- fn make_run ( run : RunConfig < ' _ > ) {
2650- run. builder . ensure ( Self ) ;
2651- }
2652- }
2653-
26542564#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
26552565pub struct LintDocs {
26562566 pub compiler : Compiler ,
0 commit comments