@@ -12,7 +12,9 @@ use super::{
1212 DisplayBracketedDuration , DisplayDurationBy , DisplaySlowDuration , write_final_warnings,
1313 write_skip_counts,
1414 } ,
15- progress:: { ProgressBarState , progress_bar_msg, progress_str, write_summary_str} ,
15+ progress:: {
16+ MaxProgressRunning , ProgressBarState , progress_bar_msg, progress_str, write_summary_str,
17+ } ,
1618 unit_output:: TestOutputDisplay ,
1719} ;
1820use crate :: {
@@ -59,6 +61,7 @@ pub(crate) struct DisplayReporterBuilder {
5961 pub ( crate ) no_capture : bool ,
6062 pub ( crate ) show_progress : ShowProgress ,
6163 pub ( crate ) no_output_indent : bool ,
64+ pub ( crate ) max_progress_running : MaxProgressRunning ,
6265}
6366
6467impl DisplayReporterBuilder {
@@ -98,6 +101,7 @@ impl DisplayReporterBuilder {
98101 let progress_bar = self . progress_bar (
99102 theme_characters. progress_chars ,
100103 theme_characters. spinner_chars ,
104+ self . max_progress_running ,
101105 ) ;
102106 let term_progress = TerminalProgress :: new ( configs, & io:: stderr ( ) ) ;
103107
@@ -107,7 +111,7 @@ impl DisplayReporterBuilder {
107111 . unwrap_or_default ( ) ;
108112
109113 ReporterStderrImpl :: Terminal {
110- progress_bar,
114+ progress_bar : progress_bar . map ( Box :: new ) ,
111115 term_progress,
112116 }
113117 }
@@ -156,6 +160,7 @@ impl DisplayReporterBuilder {
156160 & self ,
157161 progress_chars : & ' static str ,
158162 spinner_chars : & ' static str ,
163+ max_progress_running : MaxProgressRunning ,
159164 ) -> Option < ProgressBarState > {
160165 if self . no_capture {
161166 // Do not use a progress bar if --no-capture is passed in.
@@ -184,8 +189,13 @@ impl DisplayReporterBuilder {
184189 ShowProgress :: Running => true ,
185190 } ;
186191
187- let state =
188- ProgressBarState :: new ( self . test_count , progress_chars, spinner_chars, show_running) ;
192+ let state = ProgressBarState :: new (
193+ self . test_count ,
194+ progress_chars,
195+ spinner_chars,
196+ show_running,
197+ max_progress_running,
198+ ) ;
189199 // Note: even if we create a progress bar here, if stderr is
190200 // piped, indicatif will not show it.
191201 Some ( state)
@@ -254,7 +264,7 @@ enum ReporterStderrImpl<'a> {
254264 Terminal {
255265 // Reporter-specific progress bar state. None if the progress bar is not
256266 // enabled.
257- progress_bar : Option < ProgressBarState > ,
267+ progress_bar : Option < Box < ProgressBarState > > ,
258268 // OSC 9 code progress reporting.
259269 term_progress : Option < TerminalProgress > ,
260270 } ,
@@ -659,6 +669,7 @@ impl<'a> DisplayReporterImpl<'a> {
659669 run_status,
660670 delay_before_next_attempt,
661671 failure_output,
672+ running : _,
662673 } => {
663674 if self . status_levels . status_level >= StatusLevel :: Retry {
664675 let try_status_string = format ! (
@@ -737,6 +748,7 @@ impl<'a> DisplayReporterImpl<'a> {
737748 attempt,
738749 total_attempts,
739750 } ,
751+ running : _,
740752 } => {
741753 let retry_string = format ! ( "RETRY {attempt}/{total_attempts}" ) ;
742754 write ! ( writer, "{:>12} " , retry_string. style( self . styles. retry) ) ?;
@@ -2355,6 +2367,7 @@ mod tests {
23552367 no_capture : true ,
23562368 show_progress : ShowProgress :: Counter ,
23572369 no_output_indent : false ,
2370+ max_progress_running : MaxProgressRunning :: default ( ) ,
23582371 } ;
23592372 let output = ReporterStderr :: Buffer ( out) ;
23602373 let reporter = builder. build ( & configs, output) ;
0 commit comments