@@ -211,7 +211,6 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
211211 props : & props,
212212 testpaths,
213213 revision : revision,
214- is_aux : false ,
215214 } ;
216215 create_dir_all ( & cx. output_base_dir ( ) ) . unwrap ( ) ;
217216
@@ -230,7 +229,6 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
230229 props : & revision_props,
231230 testpaths,
232231 revision : Some ( revision) ,
233- is_aux : false ,
234232 } ;
235233 rev_cx. run_revision ( ) ;
236234 }
@@ -262,7 +260,7 @@ pub fn compute_stamp_hash(config: &Config) -> String {
262260 env:: var_os ( "PYTHONPATH" ) . hash ( & mut hash) ;
263261 }
264262
265- if let Ui | RunPass = config. mode {
263+ if let Ui | RunPass | Incremental = config. mode {
266264 config. force_pass_mode . hash ( & mut hash) ;
267265 }
268266
@@ -274,7 +272,6 @@ struct TestCx<'test> {
274272 props : & ' test TestProps ,
275273 testpaths : & ' test TestPaths ,
276274 revision : Option < & ' test str > ,
277- is_aux : bool ,
278275}
279276
280277struct DebuggerCommands {
@@ -316,18 +313,13 @@ impl<'test> TestCx<'test> {
316313 }
317314 }
318315
319- fn effective_pass_mode ( & self ) -> Option < PassMode > {
320- if !self . props . ignore_pass {
321- if let ( mode @ Some ( _) , Some ( _) ) = ( self . config . force_pass_mode , self . props . pass_mode ) {
322- return mode;
323- }
324- }
325- self . props . pass_mode
316+ fn pass_mode ( & self ) -> Option < PassMode > {
317+ self . props . pass_mode ( self . config )
326318 }
327319
328320 fn should_run_successfully ( & self ) -> bool {
329321 match self . config . mode {
330- RunPass | Ui => self . effective_pass_mode ( ) == Some ( PassMode :: Run ) ,
322+ RunPass | Ui => self . pass_mode ( ) == Some ( PassMode :: Run ) ,
331323 mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
332324 }
333325 }
@@ -337,15 +329,15 @@ impl<'test> TestCx<'test> {
337329 CompileFail => false ,
338330 RunPass => true ,
339331 JsDocTest => true ,
340- Ui => self . props . pass_mode . is_some ( ) ,
332+ Ui => self . pass_mode ( ) . is_some ( ) ,
341333 Incremental => {
342334 let revision = self . revision
343335 . expect ( "incremental tests require a list of revisions" ) ;
344336 if revision. starts_with ( "rpass" ) || revision. starts_with ( "rfail" ) {
345337 true
346338 } else if revision. starts_with ( "cfail" ) {
347339 // FIXME: would be nice if incremental revs could start with "cpass"
348- self . props . pass_mode . is_some ( )
340+ self . pass_mode ( ) . is_some ( )
349341 } else {
350342 panic ! ( "revision name must begin with rpass, rfail, or cfail" ) ;
351343 }
@@ -1356,7 +1348,7 @@ impl<'test> TestCx<'test> {
13561348 fn check_error_patterns ( & self , output_to_check : & str , proc_res : & ProcRes ) {
13571349 debug ! ( "check_error_patterns" ) ;
13581350 if self . props . error_patterns . is_empty ( ) {
1359- if self . props . pass_mode . is_some ( ) {
1351+ if self . pass_mode ( ) . is_some ( ) {
13601352 return ;
13611353 } else {
13621354 self . fatal ( & format ! (
@@ -1578,7 +1570,6 @@ impl<'test> TestCx<'test> {
15781570 props : & aux_props,
15791571 testpaths : & aux_testpaths,
15801572 revision : self . revision ,
1581- is_aux : true ,
15821573 } ;
15831574 // Create the directory for the stdout/stderr files.
15841575 create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
@@ -1748,7 +1739,6 @@ impl<'test> TestCx<'test> {
17481739 props : & aux_props,
17491740 testpaths : & aux_testpaths,
17501741 revision : self . revision ,
1751- is_aux : true ,
17521742 } ;
17531743 // Create the directory for the stdout/stderr files.
17541744 create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
@@ -1989,8 +1979,7 @@ impl<'test> TestCx<'test> {
19891979 }
19901980 }
19911981
1992- let pass_mode = if self . is_aux { self . props . pass_mode } else { self . effective_pass_mode ( ) } ;
1993- if let Some ( PassMode :: Check ) = pass_mode {
1982+ if let Some ( PassMode :: Check ) = self . pass_mode ( ) {
19941983 rustc. args ( & [ "--emit" , "metadata" ] ) ;
19951984 }
19961985
@@ -2728,7 +2717,6 @@ impl<'test> TestCx<'test> {
27282717 props : & revision_props,
27292718 testpaths : self . testpaths ,
27302719 revision : self . revision ,
2731- is_aux : false ,
27322720 } ;
27332721
27342722 if self . config . verbose {
0 commit comments