summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buildtool/progress_reporting/base_progress_reporter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/buildtool/progress_reporting/base_progress_reporter.cpp b/src/buildtool/progress_reporting/base_progress_reporter.cpp
index 449f1dde..563a4a00 100644
--- a/src/buildtool/progress_reporting/base_progress_reporter.cpp
+++ b/src/buildtool/progress_reporting/base_progress_reporter.cpp
@@ -45,9 +45,15 @@ auto BaseProgressReporter::Reporter() -> GraphTraverser::progress_reporter_t {
}
}
constexpr int kOneHundred{100};
+ int total_work = total - cached;
+ int progress =
+ kOneHundred; // default if no work has to be done
+ if (total_work > 0) {
+ progress = run * kOneHundred / total_work;
+ }
Logger::Log(LogLevel::Progress,
"[{:3}%] {} cached, {} run, {} processing{}.",
- (cached + run) * kOneHundred / total,
+ progress,
cached,
run,
active,