File tree 3 files changed +12
-10
lines changed
3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ pub struct TestProps {
94
94
// Extra flags to pass to the compiler
95
95
pub compile_flags : Vec < String > ,
96
96
// Extra flags to pass when the compiled code is run (such as --bench)
97
- pub run_flags : Option < String > ,
97
+ pub run_flags : Vec < String > ,
98
98
// If present, the name of a file that this test should match when
99
99
// pretty-printed
100
100
pub pp_exact : Option < PathBuf > ,
@@ -262,7 +262,7 @@ impl TestProps {
262
262
error_patterns : vec ! [ ] ,
263
263
regex_error_patterns : vec ! [ ] ,
264
264
compile_flags : vec ! [ ] ,
265
- run_flags : None ,
265
+ run_flags : vec ! [ ] ,
266
266
pp_exact : None ,
267
267
aux_builds : vec ! [ ] ,
268
268
aux_bins : vec ! [ ] ,
@@ -399,7 +399,9 @@ impl TestProps {
399
399
400
400
config. parse_and_update_revisions ( ln, & mut self . revisions ) ;
401
401
402
- config. set_name_value_directive ( ln, RUN_FLAGS , & mut self . run_flags , |r| r) ;
402
+ if let Some ( flags) = config. parse_name_value_directive ( ln, RUN_FLAGS ) {
403
+ self . run_flags . extend ( split_flags ( & flags) ) ;
404
+ }
403
405
404
406
if self . pp_exact . is_none ( ) {
405
407
self . pp_exact = config. parse_pp_exact ( ln, testfile) ;
Original file line number Diff line number Diff line change @@ -2355,7 +2355,7 @@ impl<'test> TestCx<'test> {
2355
2355
args. push ( exe_file. into_os_string ( ) ) ;
2356
2356
2357
2357
// Add the arguments in the run_flags directive
2358
- args. extend ( self . split_maybe_args ( & self . props . run_flags ) ) ;
2358
+ args. extend ( self . props . run_flags . iter ( ) . map ( OsString :: from ) ) ;
2359
2359
2360
2360
let prog = args. remove ( 0 ) ;
2361
2361
ProcArgs { prog, args }
@@ -4173,10 +4173,12 @@ impl<'test> TestCx<'test> {
4173
4173
}
4174
4174
4175
4175
fn normalize_output ( & self , output : & str , custom_rules : & [ ( String , String ) ] ) -> String {
4176
- let rflags = self . props . run_flags . as_ref ( ) ;
4176
+ // Crude heuristic to detect when the output should have JSON-specific
4177
+ // normalization steps applied.
4178
+ let rflags = self . props . run_flags . join ( " " ) ;
4177
4179
let cflags = self . props . compile_flags . join ( " " ) ;
4178
- let json = rflags
4179
- . map_or ( false , |s| s . contains ( "--format json" ) || s . contains ( "--format =json") )
4180
+ let json = rflags. contains ( "--format json" )
4181
+ || rflags . contains ( "--format=json" )
4180
4182
|| cflags. contains ( "--error-format json" )
4181
4183
|| cflags. contains ( "--error-format pretty-json" )
4182
4184
|| cflags. contains ( "--error-format=json" )
Original file line number Diff line number Diff line change @@ -123,9 +123,7 @@ If you want to install the `browser-ui-test` dependency, run `npm install browse
123
123
cargo. env ( "RUSTDOCFLAGS" , test_props. compile_flags . join ( " " ) ) ;
124
124
}
125
125
126
- if let Some ( flags) = & test_props. run_flags {
127
- cargo. arg ( flags) ;
128
- }
126
+ cargo. args ( & test_props. run_flags ) ;
129
127
}
130
128
131
129
if try_run ( & mut cargo, config. verbose ) . is_err ( ) {
You can’t perform that action at this time.
0 commit comments