@@ -495,11 +495,16 @@ impl Toolchain {
495
495
fn test ( & self , cfg : & Config ) -> TestOutcome {
496
496
let outcome = if cfg. args . prompt {
497
497
loop {
498
- let status = self . run_test ( cfg) ;
498
+ let output = self . run_test ( cfg) ;
499
+ let status = output. status ( ) ;
499
500
500
501
eprintln ! ( "\n \n {} finished with exit code {:?}." , self , status. code( ) ) ;
501
502
eprintln ! ( "please select an action to take:" ) ;
502
503
504
+ // FIXME: should this use `Config::default_outcome_of_output`
505
+ // for inferring the default below, rather than always
506
+ // defaulting to "mark regressed"?
507
+
503
508
match Select :: new ( )
504
509
. items ( & [ "mark regressed" , "mark baseline" , "retry" ] )
505
510
. default ( 0 )
@@ -513,17 +518,27 @@ impl Toolchain {
513
518
}
514
519
}
515
520
} else {
516
- if self . run_test ( cfg) . success ( ) {
517
- TestOutcome :: Baseline
518
- } else {
519
- TestOutcome :: Regressed
520
- }
521
+ let output = self . run_test ( cfg) ;
522
+ cfg. default_outcome_of_output ( output)
521
523
} ;
522
524
523
525
outcome
524
526
}
527
+ }
525
528
526
- fn run_test ( & self , cfg : & Config ) -> process:: ExitStatus {
529
+ impl Config {
530
+ fn default_outcome_of_output ( & self , process:: Output ) -> TestOutcome {
531
+ let status = output. status ( ) ;
532
+ if status. success ( ) {
533
+ TestOutcome :: Baseline
534
+ } else {
535
+ TestOutcome :: Regressed
536
+ }
537
+ }
538
+ }
539
+
540
+ impl Toolchain {
541
+ fn run_test ( & self , cfg : & Config ) -> process:: Output {
527
542
if !cfg. args . preserve_target {
528
543
let _ = fs:: remove_dir_all (
529
544
cfg. args
@@ -557,14 +572,14 @@ impl Toolchain {
557
572
cmd. stdout ( Stdio :: null ( ) ) ;
558
573
cmd. stderr ( Stdio :: null ( ) ) ;
559
574
}
560
- let status = match cmd. status ( ) {
561
- Ok ( status ) => status ,
575
+ let output = match cmd. output ( ) {
576
+ Ok ( output ) => output ,
562
577
Err ( err) => {
563
578
panic ! ( "failed to run {:?}: {:?}" , cmd, err) ;
564
579
}
565
580
} ;
566
581
567
- status
582
+ output
568
583
}
569
584
570
585
fn install ( & self , client : & Client , dl_params : & DownloadParams ) -> Result < ( ) , InstallError > {
0 commit comments