@@ -115,7 +115,7 @@ pub fn test_main(args: &[String], tests: Vec<TestDescAndFn>, options: Option<Opt
115115 process:: exit ( ERROR_EXIT_CODE ) ;
116116 }
117117 } else {
118- if ! opts. nocapture {
118+ if opts. capture {
119119 // If we encounter a non-unwinding panic, flush any captured output from the current test,
120120 // and stop capturing output to ensure that the non-unwinding panic message is visible.
121121 // We also acquire the locks for both output streams to prevent output from other threads
@@ -574,15 +574,15 @@ pub fn run_test(
574574 }
575575
576576 let name = desc. name . clone ( ) ;
577- let nocapture = opts. nocapture ;
577+ let capture = opts. capture ;
578578 let time_options = opts. time_options ;
579579 let bench_benchmarks = opts. bench_benchmarks ;
580580
581581 let runtest = move || match strategy {
582582 RunStrategy :: InProcess => run_test_in_process (
583583 id,
584584 desc,
585- nocapture ,
585+ capture ,
586586 time_options. is_some ( ) ,
587587 runnable_test,
588588 monitor_ch,
@@ -591,7 +591,7 @@ pub fn run_test(
591591 RunStrategy :: SpawnPrimary => spawn_test_subprocess (
592592 id,
593593 desc,
594- nocapture ,
594+ capture ,
595595 time_options. is_some ( ) ,
596596 monitor_ch,
597597 time_options,
@@ -626,7 +626,7 @@ pub fn run_test(
626626 }
627627 Runnable :: Bench ( runnable_bench) => {
628628 // Benchmarks aren't expected to panic, so we run them all in-process.
629- runnable_bench. run ( id, & desc, & monitor_ch, opts. nocapture ) ;
629+ runnable_bench. run ( id, & desc, & monitor_ch, opts. capture ) ;
630630 None
631631 }
632632 }
@@ -644,7 +644,7 @@ fn __rust_begin_short_backtrace<T, F: FnOnce() -> T>(f: F) -> T {
644644fn run_test_in_process (
645645 id : TestId ,
646646 desc : TestDesc ,
647- nocapture : bool ,
647+ capture : bool ,
648648 report_time : bool ,
649649 runnable_test : RunnableTest ,
650650 monitor_ch : Sender < CompletedTest > ,
@@ -653,7 +653,7 @@ fn run_test_in_process(
653653 // Buffer for capturing standard I/O
654654 let data = Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ;
655655
656- if !nocapture {
656+ if capture {
657657 io:: set_output_capture ( Some ( data. clone ( ) ) ) ;
658658 }
659659
@@ -691,7 +691,7 @@ where
691691fn spawn_test_subprocess (
692692 id : TestId ,
693693 desc : TestDesc ,
694- nocapture : bool ,
694+ capture : bool ,
695695 report_time : bool ,
696696 monitor_ch : Sender < CompletedTest > ,
697697 time_opts : Option < time:: TestTimeOptions > ,
@@ -706,7 +706,7 @@ fn spawn_test_subprocess(
706706 if bench_benchmarks {
707707 command. env ( SECONDARY_TEST_BENCH_BENCHMARKS_VAR , "1" ) ;
708708 }
709- if nocapture {
709+ if !capture {
710710 command. stdout ( process:: Stdio :: inherit ( ) ) ;
711711 command. stderr ( process:: Stdio :: inherit ( ) ) ;
712712 }
0 commit comments