@@ -55,73 +55,54 @@ fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool {
55
55
}
56
56
57
57
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
58
- pub struct CrateJsonDocLint {
58
+ pub struct CrateBootstrap {
59
+ path : Interned < PathBuf > ,
59
60
host : TargetSelection ,
60
61
}
61
62
62
- impl Step for CrateJsonDocLint {
63
+ impl Step for CrateBootstrap {
63
64
type Output = ( ) ;
64
65
const ONLY_HOSTS : bool = true ;
65
66
const DEFAULT : bool = true ;
66
67
67
68
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
68
69
run. path ( "src/tools/jsondoclint" )
70
+ . path ( "src/tools/suggest-tests" )
71
+ . path ( "src/tools/replace-version-placeholder" )
72
+ . alias ( "tidyselftest" )
69
73
}
70
74
71
75
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
+ }
73
80
}
74
81
75
82
fn run ( self , builder : & Builder < ' _ > ) {
76
83
let bootstrap_host = builder. config . build ;
77
84
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
+ }
78
89
79
90
let cargo = tool:: prepare_tool_cargo (
80
91
builder,
81
92
compiler,
82
93
Mode :: ToolBootstrap ,
83
94
bootstrap_host,
84
95
"test" ,
85
- "src/tools/jsondoclint" ,
96
+ path ,
86
97
SourceType :: InTree ,
87
98
& [ ] ,
88
99
) ;
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,
119
104
bootstrap_host,
120
- "test" ,
121
- "src/tools/suggest-tests" ,
122
- SourceType :: InTree ,
123
- & [ ] ,
124
- ) ;
105
+ ) ) ;
125
106
run_cargo_test ( cargo, & [ ] , & [ ] , compiler, bootstrap_host, builder) ;
126
107
}
127
108
}
@@ -1151,40 +1132,6 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
1151
1132
}
1152
1133
}
1153
1134
1154
- /// Runs tidy's own tests.
1155
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1156
- pub struct TidySelfTest ;
1157
-
1158
- impl Step for TidySelfTest {
1159
- type Output = ( ) ;
1160
- const DEFAULT : bool = true ;
1161
- const ONLY_HOSTS : bool = true ;
1162
-
1163
- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1164
- run. alias ( "tidyselftest" )
1165
- }
1166
-
1167
- fn make_run ( run : RunConfig < ' _ > ) {
1168
- run. builder . ensure ( TidySelfTest ) ;
1169
- }
1170
-
1171
- fn run ( self , builder : & Builder < ' _ > ) {
1172
- let bootstrap_host = builder. config . build ;
1173
- let compiler = builder. compiler ( 0 , bootstrap_host) ;
1174
- let cargo = tool:: prepare_tool_cargo (
1175
- builder,
1176
- compiler,
1177
- Mode :: ToolBootstrap ,
1178
- bootstrap_host,
1179
- "test" ,
1180
- "src/tools/tidy" ,
1181
- SourceType :: InTree ,
1182
- & [ ] ,
1183
- ) ;
1184
- run_cargo_test ( cargo, & [ ] , & [ ] , compiler, bootstrap_host, builder) ;
1185
- }
1186
- }
1187
-
1188
1135
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1189
1136
pub struct ExpandYamlAnchors ;
1190
1137
@@ -2613,43 +2560,6 @@ impl Step for TierCheck {
2613
2560
}
2614
2561
}
2615
2562
2616
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
2617
- pub struct ReplacePlaceholderTest ;
2618
-
2619
- impl Step for ReplacePlaceholderTest {
2620
- type Output = ( ) ;
2621
- const ONLY_HOSTS : bool = true ;
2622
- const DEFAULT : bool = true ;
2623
-
2624
- /// Ensure the version placeholder replacement tool builds
2625
- fn run ( self , builder : & Builder < ' _ > ) {
2626
- builder. info ( "build check for version replacement placeholder" ) ;
2627
-
2628
- // Test the version placeholder replacement tool itself.
2629
- let bootstrap_host = builder. config . build ;
2630
- let compiler = builder. compiler ( 0 , bootstrap_host) ;
2631
- let cargo = tool:: prepare_tool_cargo (
2632
- builder,
2633
- compiler,
2634
- Mode :: ToolBootstrap ,
2635
- bootstrap_host,
2636
- "test" ,
2637
- "src/tools/replace-version-placeholder" ,
2638
- SourceType :: InTree ,
2639
- & [ ] ,
2640
- ) ;
2641
- add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
2642
- }
2643
-
2644
- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
2645
- run. path ( "src/tools/replace-version-placeholder" )
2646
- }
2647
-
2648
- fn make_run ( run : RunConfig < ' _ > ) {
2649
- run. builder . ensure ( Self ) ;
2650
- }
2651
- }
2652
-
2653
2563
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
2654
2564
pub struct LintDocs {
2655
2565
pub compiler : Compiler ,
0 commit comments