File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -460,16 +460,22 @@ fn run_test(
460460 cmd. current_dir ( run_directory) ;
461461 }
462462
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 {
464473 Err ( e) => return Err ( TestFailure :: ExecutionError ( e) ) ,
465474 Ok ( out) => {
466475 if should_panic && out. status . success ( ) {
467476 return Err ( TestFailure :: UnexpectedRunPass ) ;
468477 } else if !should_panic && !out. status . success ( ) {
469478 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" ) ;
473479 }
474480 }
475481 }
You can’t perform that action at this time.
0 commit comments