@@ -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
}
@@ -1147,40 +1128,6 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
1147
1128
}
1148
1129
}
1149
1130
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
-
1184
1131
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1185
1132
pub struct ExpandYamlAnchors ;
1186
1133
@@ -2614,43 +2561,6 @@ impl Step for TierCheck {
2614
2561
}
2615
2562
}
2616
2563
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
-
2654
2564
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
2655
2565
pub struct LintDocs {
2656
2566
pub compiler : Compiler ,
0 commit comments