@@ -97,7 +97,7 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
97
97
output_conflict_handling,
98
98
out_dir : PathBuf :: from ( std:: env:: var_os ( "CARGO_TARGET_DIR" ) . unwrap ( ) ) . join ( "ui" ) ,
99
99
edition : Some ( "2021" . into ( ) ) ,
100
- ..Config :: rustc ( path. into ( ) )
100
+ ..Config :: rustc ( path)
101
101
} ;
102
102
103
103
let use_std = env:: var_os ( "MIRI_NO_STD" ) . is_none ( ) ;
@@ -123,49 +123,19 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
123
123
let config = test_config ( target, path, mode, with_dependencies) ;
124
124
125
125
// Handle command-line arguments.
126
- let mut after_dashdash = false ;
127
- let mut quiet = false ;
128
- let filters = std:: env:: args ( )
129
- . skip ( 1 )
130
- . filter ( |arg| {
131
- if after_dashdash {
132
- // Just propagate everything.
133
- return true ;
134
- }
135
- match & * * arg {
136
- "--quiet" => {
137
- quiet = true ;
138
- false
139
- }
140
- "--" => {
141
- after_dashdash = true ;
142
- false
143
- }
144
- s if s. starts_with ( '-' ) => {
145
- panic ! ( "unknown compiletest flag `{s}`" ) ;
146
- }
147
- _ => true ,
148
- }
149
- } )
150
- . collect :: < Vec < _ > > ( ) ;
126
+ let args = ui_test:: Args :: test ( ) ;
127
+ let quiet = args. quiet ;
151
128
eprintln ! ( " Compiler: {}" , config. program. display( ) ) ;
152
129
ui_test:: run_tests_generic (
153
- config,
130
+ vec ! [ config] ,
131
+ std:: thread:: available_parallelism ( ) . unwrap ( ) ,
132
+ args,
154
133
// The files we're actually interested in (all `.rs` files).
155
- |path| {
156
- path. extension ( ) . is_some_and ( |ext| ext == "rs" )
157
- && ( filters. is_empty ( )
158
- || filters. iter ( ) . any ( |f| path. display ( ) . to_string ( ) . contains ( f) ) )
159
- } ,
134
+ ui_test:: default_file_filter,
160
135
// This could be used to overwrite the `Config` on a per-test basis.
161
- |_, _| None ,
136
+ |_, _| { } ,
162
137
(
163
- if quiet {
164
- Box :: < status_emitter:: Quiet > :: default ( )
165
- as Box < dyn status_emitter:: StatusEmitter + Send >
166
- } else {
167
- Box :: new ( status_emitter:: Text )
168
- } ,
138
+ if quiet { status_emitter:: Text :: quiet ( ) } else { status_emitter:: Text :: verbose ( ) } ,
169
139
status_emitter:: Gha :: < /* GHA Actions groups*/ false > {
170
140
name : format ! ( "{mode:?} {path} ({target})" ) ,
171
141
} ,
@@ -269,11 +239,16 @@ fn main() -> Result<()> {
269
239
ui ( Mode :: Pass , "tests/pass" , & target, WithoutDependencies ) ?;
270
240
ui ( Mode :: Pass , "tests/pass-dep" , & target, WithDependencies ) ?;
271
241
ui ( Mode :: Panic , "tests/panic" , & target, WithDependencies ) ?;
272
- ui ( Mode :: Fail { require_patterns : true } , "tests/fail" , & target, WithDependencies ) ?;
242
+ ui (
243
+ Mode :: Fail { require_patterns : true , rustfix : false } ,
244
+ "tests/fail" ,
245
+ & target,
246
+ WithDependencies ,
247
+ ) ?;
273
248
if cfg ! ( target_os = "linux" ) {
274
249
ui ( Mode :: Pass , "tests/extern-so/pass" , & target, WithoutDependencies ) ?;
275
250
ui (
276
- Mode :: Fail { require_patterns : true } ,
251
+ Mode :: Fail { require_patterns : true , rustfix : false } ,
277
252
"tests/extern-so/fail" ,
278
253
& target,
279
254
WithoutDependencies ,
@@ -285,11 +260,13 @@ fn main() -> Result<()> {
285
260
286
261
fn run_dep_mode ( target : String , mut args : impl Iterator < Item = OsString > ) -> Result < ( ) > {
287
262
let path = args. next ( ) . expect ( "./miri run-dep must be followed by a file name" ) ;
288
- let mut config = test_config ( & target, "" , Mode :: Yolo , /* with dependencies */ true ) ;
263
+ let mut config =
264
+ test_config ( & target, "" , Mode :: Yolo { rustfix : false } , /* with dependencies */ true ) ;
289
265
config. program . args . clear ( ) ; // We want to give the user full control over flags
290
- config. build_dependencies_and_link_them ( ) ?;
266
+ let dep_args = config. build_dependencies ( ) ?;
291
267
292
268
let mut cmd = config. program . build ( & config. out_dir ) ;
269
+ cmd. args ( dep_args) ;
293
270
294
271
cmd. arg ( path) ;
295
272
0 commit comments