Skip to content

Commit 6215566

Browse files
committed
ProcessExecutor: added (partial) missing printing of timing information and added TODO
1 parent eca4612 commit 6215566

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/path.h li
660660
cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h
661661
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/main.cpp
662662

663-
cli/processexecutor.o: cli/processexecutor.cpp cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
663+
cli/processexecutor.o: cli/processexecutor.cpp cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
664664
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/processexecutor.cpp
665665

666666
cli/singleexecutor.o: cli/singleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h

cli/processexecutor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "importproject.h"
2929
#include "settings.h"
3030
#include "suppressions.h"
31+
#include "timer.h"
3132

3233
#include <algorithm>
3334
#include <numeric>
@@ -375,6 +376,9 @@ unsigned int ProcessExecutor::check()
375376
}
376377
}
377378

379+
// TODO: wee need to get the timing information from the subprocess
380+
if (mSettings.showtime == SHOWTIME_MODES::SHOWTIME_SUMMARY || mSettings.showtime == SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY)
381+
CppCheck::printTimerResults(mSettings.showtime);
378382

379383
return result;
380384
}

test/testprocessexecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class TestProcessExecutor : public TestFixture {
263263
$.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY));
264264
const std::string output_s = GET_REDIRECT_OUTPUT;
265265
// once: top5 results + overall + empty line
266-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
266+
TODO_ASSERT_EQUALS(5 + 1 + 1, 2, cppcheck::count_all_of(output_s, '\n'));
267267
// should only report the top5 once
268268
ASSERT(output_s.find("1 result(s)") == std::string::npos);
269269
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);

0 commit comments

Comments
 (0)