@@ -61,6 +61,7 @@ pub enum Subcommand {
6161 paths : Vec < PathBuf > ,
6262 /// Whether to automatically update stderr/stdout files
6363 bless : bool ,
64+ compare_mode : Option < String > ,
6465 test_args : Vec < String > ,
6566 rustc_args : Vec < String > ,
6667 fail_fast : bool ,
@@ -176,6 +177,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
176177 opts. optflag ( "" , "no-doc" , "do not run doc tests" ) ;
177178 opts. optflag ( "" , "doc" , "only run doc tests" ) ;
178179 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" ) ;
179181 } ,
180182 "bench" => { opts. optmulti ( "" , "test-args" , "extra arguments" , "ARGS" ) ; } ,
181183 "clean" => { opts. optflag ( "" , "all" , "clean all build artifacts" ) ; } ,
@@ -262,6 +264,7 @@ Arguments:
262264 ./x.py test src/libstd --test-args hash_map
263265 ./x.py test src/libstd --stage 0
264266 ./x.py test src/test/ui --bless
267+ ./x.py test src/test/ui --compare-mode nll
265268
266269 If no arguments are passed then the complete artifacts for that stage are
267270 compiled and tested.
@@ -327,6 +330,7 @@ Arguments:
327330 Subcommand :: Test {
328331 paths,
329332 bless : matches. opt_present ( "bless" ) ,
333+ compare_mode : matches. opt_str ( "compare-mode" ) ,
330334 test_args : matches. opt_strs ( "test-args" ) ,
331335 rustc_args : matches. opt_strs ( "rustc-args" ) ,
332336 fail_fast : !matches. opt_present ( "no-fail-fast" ) ,
@@ -436,6 +440,13 @@ impl Subcommand {
436440 _ => false ,
437441 }
438442 }
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+ }
439450}
440451
441452fn split ( s : Vec < String > ) -> Vec < String > {
0 commit comments