@@ -61,6 +61,7 @@ pub enum Subcommand {
61
61
paths : Vec < PathBuf > ,
62
62
/// Whether to automatically update stderr/stdout files
63
63
bless : bool ,
64
+ compare_mode : Option < String > ,
64
65
test_args : Vec < String > ,
65
66
rustc_args : Vec < String > ,
66
67
fail_fast : bool ,
@@ -176,6 +177,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
176
177
opts. optflag ( "" , "no-doc" , "do not run doc tests" ) ;
177
178
opts. optflag ( "" , "doc" , "only run doc tests" ) ;
178
179
opts. optflag ( "" , "bless" , "update all stderr/stdout files of failing ui tests" ) ;
180
+ opts. optopt ( "" , "compare-mode" , "mode describing what file the actual ui output will be compared to" , "COMPARE MODE" ) ;
179
181
} ,
180
182
"bench" => { opts. optmulti ( "" , "test-args" , "extra arguments" , "ARGS" ) ; } ,
181
183
"clean" => { opts. optflag ( "" , "all" , "clean all build artifacts" ) ; } ,
@@ -262,6 +264,7 @@ Arguments:
262
264
./x.py test src/libstd --test-args hash_map
263
265
./x.py test src/libstd --stage 0
264
266
./x.py test src/test/ui --bless
267
+ ./x.py test src/test/ui --compare-mode nll
265
268
266
269
If no arguments are passed then the complete artifacts for that stage are
267
270
compiled and tested.
@@ -327,6 +330,7 @@ Arguments:
327
330
Subcommand :: Test {
328
331
paths,
329
332
bless : matches. opt_present ( "bless" ) ,
333
+ compare_mode : matches. opt_str ( "compare-mode" ) ,
330
334
test_args : matches. opt_strs ( "test-args" ) ,
331
335
rustc_args : matches. opt_strs ( "rustc-args" ) ,
332
336
fail_fast : !matches. opt_present ( "no-fail-fast" ) ,
@@ -436,6 +440,13 @@ impl Subcommand {
436
440
_ => false ,
437
441
}
438
442
}
443
+
444
+ pub fn compare_mode ( & self ) -> Option < & str > {
445
+ match * self {
446
+ Subcommand :: Test { ref compare_mode, .. } => compare_mode. as_ref ( ) . map ( |s| & s[ ..] ) ,
447
+ _ => None ,
448
+ }
449
+ }
439
450
}
440
451
441
452
fn split ( s : Vec < String > ) -> Vec < String > {
0 commit comments