diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 32607e947..74d32ce25 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -114,7 +114,7 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c { std::vector::iterator iter; for (iter = filenames.begin(); iter != filenames.end(); ++iter) - cppcheck->addFile(*iter); + _filenames.push_back(*iter); return true; } @@ -146,7 +146,14 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) if (_settings._jobs == 1) { // Single process - returnValue = cppCheck.check(); + for (unsigned int c = 0; c < _filenames.size(); c++) + { + cppCheck.addFile(_filenames[c]); + returnValue += cppCheck.check(); + cppCheck.clearFiles(); + + reportStatus(c + 1, _filenames.size()); + } } else if (!ThreadExecutor::isEnabled()) { @@ -155,9 +162,8 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) else { // Multiple processes - const std::vector &filenames = cppCheck.filenames(); Settings &settings = cppCheck.settings(); - ThreadExecutor executor(filenames, settings, *this); + ThreadExecutor executor(_filenames, settings, *this); returnValue = executor.check(); } diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index 339d16959..3a0828024 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -22,6 +22,7 @@ #include "errorlogger.h" #include "settings.h" #include +#include class CppCheck; @@ -107,6 +108,11 @@ private: * Has --errorlist been given? */ bool errorlist; + + /** + * List of files to check. + */ + std::vector _filenames; }; #endif // CPPCHECKEXECUTOR_H