File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -460,16 +460,22 @@ fn run_test(
460
460
cmd. current_dir ( run_directory) ;
461
461
}
462
462
463
- match cmd. output ( ) {
463
+ let result = if options. nocapture {
464
+ cmd. status ( ) . map ( |status| process:: Output {
465
+ status,
466
+ stdout : Vec :: new ( ) ,
467
+ stderr : Vec :: new ( ) ,
468
+ } )
469
+ } else {
470
+ cmd. output ( )
471
+ } ;
472
+ match result {
464
473
Err ( e) => return Err ( TestFailure :: ExecutionError ( e) ) ,
465
474
Ok ( out) => {
466
475
if should_panic && out. status . success ( ) {
467
476
return Err ( TestFailure :: UnexpectedRunPass ) ;
468
477
} else if !should_panic && !out. status . success ( ) {
469
478
return Err ( TestFailure :: ExecutionFailure ( out) ) ;
470
- } else if options. nocapture {
471
- io:: stdout ( ) . write_all ( & out. stdout ) . expect ( "failed to write stdout" ) ;
472
- io:: stderr ( ) . write_all ( & out. stderr ) . expect ( "failed to write stderr" ) ;
473
479
}
474
480
}
475
481
}
You can’t perform that action at this time.
0 commit comments