@@ -114,34 +114,26 @@ fn canonicalize(path: impl AsRef<Path>) -> PathBuf {
114
114
}
115
115
116
116
fn base_config ( test_dir : & str ) -> ( Config , Args ) {
117
- let bless = var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) || env:: args ( ) . any ( |arg| arg == "--bless" ) ;
118
-
119
- let args = Args {
120
- filters : env:: var ( "TESTNAME" )
121
- . map ( |filters| filters. split ( ',' ) . map ( str:: to_string) . collect ( ) )
122
- . unwrap_or_default ( ) ,
123
- quiet : false ,
124
- check : !bless,
125
- threads : match std:: env:: var_os ( "RUST_TEST_THREADS" ) {
126
- Some ( n) => n. to_str ( ) . unwrap ( ) . parse ( ) . unwrap ( ) ,
127
- None => std:: thread:: available_parallelism ( ) . unwrap ( ) ,
128
- } ,
129
- skip : Vec :: new ( ) ,
130
- } ;
117
+ let mut args = Args :: test ( ) . unwrap ( ) ;
118
+ args. bless |= var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) ;
131
119
132
120
let mut config = Config {
133
- mode : Mode :: Yolo { rustfix : true } ,
121
+ mode : Mode :: Yolo {
122
+ rustfix : ui_test:: RustfixMode :: Everything ,
123
+ } ,
134
124
stderr_filters : vec ! [ ( Match :: PathBackslash , b"/" ) ] ,
135
125
stdout_filters : vec ! [ ] ,
136
- output_conflict_handling : if bless {
137
- OutputConflictHandling :: Bless
138
- } else {
139
- OutputConflictHandling :: Error ( "cargo uibless" . into ( ) )
140
- } ,
126
+ filter_files : env:: var ( "TESTNAME" )
127
+ . map ( |filters| filters. split ( ',' ) . map ( str:: to_string) . collect ( ) )
128
+ . unwrap_or_default ( ) ,
141
129
target : None ,
142
130
out_dir : canonicalize ( var_os ( "CARGO_TARGET_DIR" ) . unwrap_or_else ( || "target" . into ( ) ) ) . join ( "ui_test" ) ,
143
131
..Config :: rustc ( Path :: new ( "tests" ) . join ( test_dir) )
144
132
} ;
133
+ config. with_args ( & args, /* bless by default */ false ) ;
134
+ if let OutputConflictHandling :: Error ( err) = & mut config. output_conflict_handling {
135
+ * err = "cargo uibless" . into ( ) ;
136
+ }
145
137
let current_exe_path = env:: current_exe ( ) . unwrap ( ) ;
146
138
let deps_path = current_exe_path. parent ( ) . unwrap ( ) ;
147
139
let profile_path = deps_path. parent ( ) . unwrap ( ) ;
@@ -184,7 +176,6 @@ fn run_ui() {
184
176
185
177
ui_test:: run_tests_generic (
186
178
vec ! [ config] ,
187
- args,
188
179
ui_test:: default_file_filter,
189
180
ui_test:: default_per_file_config,
190
181
if quiet {
@@ -209,7 +200,6 @@ fn run_internal_tests() {
209
200
210
201
ui_test:: run_tests_generic (
211
202
vec ! [ config] ,
212
- args,
213
203
ui_test:: default_file_filter,
214
204
ui_test:: default_per_file_config,
215
205
if quiet {
@@ -243,7 +233,6 @@ fn run_ui_toml() {
243
233
244
234
ui_test:: run_tests_generic (
245
235
vec ! [ config] ,
246
- args,
247
236
ui_test:: default_file_filter,
248
237
|config, path, _file_contents| {
249
238
config
@@ -302,8 +291,7 @@ fn run_ui_cargo() {
302
291
303
292
ui_test:: run_tests_generic (
304
293
vec ! [ config] ,
305
- args,
306
- |path, args, _config| path. ends_with ( "Cargo.toml" ) && ui_test:: default_filter_by_arg ( path, args) ,
294
+ |path, config| path. ends_with ( "Cargo.toml" ) && ui_test:: default_any_file_filter ( path, config) ,
307
295
|config, path, _file_contents| {
308
296
config. out_dir = canonicalize (
309
297
std:: env:: current_dir ( )
0 commit comments