Revert "Fixed #3450 (CLI --report-progress is currently useless)"

This reverts commit e769fe6294.
This commit is contained in:
Daniel Marjamäki 2012-01-02 07:42:39 +01:00
parent e769fe6294
commit 112873e876
5 changed files with 8 additions and 8 deletions

View File

@ -412,7 +412,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
// Report progress
else if (strcmp(argv[i], "--report-progress") == 0) {
_settings->reportProgressTime = 10;
_settings->reportProgress = true;
}
// --std

View File

@ -161,7 +161,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
return EXIT_FAILURE;
}
if (_settings.reportProgressTime > 0)
if (cppCheck.settings().reportProgress)
time1 = std::time(0);
_settings = cppCheck.settings();
@ -247,12 +247,12 @@ void CppCheckExecutor::reportProgress(const std::string &filename, const char st
{
(void)filename;
if (_settings.reportProgressTime == 0)
if (!time1)
return;
// Report progress messages every 10 seconds
const std::time_t time2 = std::time(NULL);
if (time2 >= (time1 + _settings.reportProgressTime)) {
if (time2 >= (time1 + 10)) {
time1 = time2;
// current time in the format "Www Mmm dd hh:mm:ss yyyy"

View File

@ -43,7 +43,7 @@ Settings::Settings()
inconclusive = false;
experimental = false;
test_2_pass = false;
reportProgressTime = 0;
reportProgress = false;
ifcfg = false;
checkConfiguration = false;

View File

@ -156,8 +156,8 @@ public:
/** @brief Experimental 2 pass checking of files */
bool test_2_pass;
/** @brief 0 => don't report progress. 1-.. => report progress every T seconds */
unsigned char reportProgressTime;
/** @brief --report-progress */
bool reportProgress;
/**
* @brief Is there any preprocessor configurations in the source code?

View File

@ -616,7 +616,7 @@ private:
Settings settings;
CmdLineParser parser(&settings);
ASSERT(parser.ParseFromArgs(3, argv));
ASSERT_EQUALS(10U, settings.reportProgressTime);
ASSERT(settings.reportProgress);
}
void stdposix() {