@@ -271,6 +271,8 @@ pub struct FuzzedExecutorExecutionConfiguration {
271271 pub num_threads : usize ,
272272 /// Maximum time in seconds to spend fuzzing (default: no timeout)
273273 pub timeout : u64 ,
274+ /// Whether to output progress to stdout or not.
275+ pub show_progress : bool ,
274276}
275277
276278pub enum FuzzedExecutorFailureConfiguration {
@@ -321,6 +323,9 @@ pub struct FuzzedExecutor<E, F> {
321323 /// Number of threads to use
322324 num_threads : usize ,
323325
326+ /// Whether to output progress to stdout or not.
327+ show_progress : bool ,
328+
324329 /// Determines what is considered a failure during execution
325330 failure_configuration : FuzzedExecutorFailureConfiguration ,
326331
@@ -391,6 +396,7 @@ impl<
391396 package_name : package_name. to_string ( ) ,
392397 function_name : function_name. to_string ( ) ,
393398 num_threads : fuzz_execution_config. num_threads ,
399+ show_progress : fuzz_execution_config. show_progress ,
394400 failure_configuration,
395401 corpus_dir : PathBuf :: from (
396402 folder_configuration. corpus_dir . unwrap_or ( DEFAULT_CORPUS_FOLDER . to_string ( ) ) ,
@@ -530,17 +536,19 @@ impl<
530536 minimized_corpus_path =
531537 minimized_corpus. as_ref ( ) . unwrap ( ) . get_corpus_storage_path ( ) . to_path_buf ( ) ;
532538 }
533- let _ = display_starting_info (
534- self . minimize_corpus ,
535- seed,
536- starting_corpus_ids. len ( ) ,
537- self . num_threads ,
538- & self . package_name ,
539- & self . function_name ,
540- corpus. get_corpus_storage_path ( ) ,
541- & minimized_corpus_path,
542- abi_change_detected,
543- ) ;
539+ if self . show_progress {
540+ let _ = display_starting_info (
541+ self . minimize_corpus ,
542+ seed,
543+ starting_corpus_ids. len ( ) ,
544+ self . num_threads ,
545+ & self . package_name ,
546+ & self . function_name ,
547+ corpus. get_corpus_storage_path ( ) ,
548+ & minimized_corpus_path,
549+ abi_change_detected,
550+ ) ;
551+ }
544552
545553 // Generate the default input (it is needed if the corpus is empty)
546554 let default_map = self . mutator . generate_default_input_map ( ) ;
@@ -745,7 +753,9 @@ impl<
745753 all_fuzzing_results. iter ( ) . find ( |fast_result| fast_result. failed ( ) )
746754 {
747755 self . metrics . set_active_corpus_size ( corpus. get_testcase_count ( ) ) ;
748- let _ = display_metrics ( & self . metrics ) ;
756+ if self . show_progress {
757+ let _ = display_metrics ( & self . metrics ) ;
758+ }
749759 break individual_failing_result. outcome ( ) . clone ( ) ;
750760 }
751761
@@ -934,7 +944,9 @@ impl<
934944 // If we've found something, return
935945 if let Some ( result) = failing_result {
936946 self . metrics . set_active_corpus_size ( corpus. get_testcase_count ( ) ) ;
937- let _ = display_metrics ( & self . metrics ) ;
947+ if self . show_progress {
948+ let _ = display_metrics ( & self . metrics ) ;
949+ }
938950 break result;
939951 }
940952 if time_tracker. elapsed ( ) - last_metric_check
@@ -943,7 +955,9 @@ impl<
943955 // Update and display metrics
944956 self . metrics . set_active_corpus_size ( corpus. get_testcase_count ( ) ) ;
945957 self . metrics . set_last_round_update_time ( updating_time) ;
946- let _ = display_metrics ( & self . metrics ) ;
958+ if self . show_progress {
959+ let _ = display_metrics ( & self . metrics ) ;
960+ }
947961 self . metrics . refresh_round ( ) ;
948962 last_metric_check = time_tracker. elapsed ( ) ;
949963 // Check if we've exceeded the timeout
0 commit comments