tools/reduce: speedup, terminate checking when error is found
This commit is contained in:
parent
d2e8ab9c86
commit
6ee32943f2
|
@ -20,19 +20,25 @@ public:
|
||||||
, cppcheck(*this,false)
|
, cppcheck(*this,false)
|
||||||
, line(':' + l + ']')
|
, line(':' + l + ']')
|
||||||
, foundLine(false) {
|
, foundLine(false) {
|
||||||
cppcheck.settings().addEnabled("all");
|
|
||||||
cppcheck.settings().inconclusive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool run(const char filename[]) {
|
bool run(const char filename[]) {
|
||||||
foundLine = false;
|
foundLine = false;
|
||||||
|
Settings settings;
|
||||||
|
settings.addEnabled("all");
|
||||||
|
settings.inconclusive = true;
|
||||||
|
settings._force = true;
|
||||||
|
cppcheck.settings() = settings;
|
||||||
cppcheck.check(filename);
|
cppcheck.check(filename);
|
||||||
return foundLine;
|
return foundLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reportOut(const std::string &outmsg) { }
|
void reportOut(const std::string &outmsg) { }
|
||||||
void reportErr(const ErrorLogger::ErrorMessage &msg) {
|
void reportErr(const ErrorLogger::ErrorMessage &msg) {
|
||||||
foundLine |= bool(msg.toString(false).find(line) != std::string::npos);
|
if (msg.toString(false).find(line) != std::string::npos) {
|
||||||
|
foundLine = true;
|
||||||
|
cppcheck.terminate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void reportProgress(const std::string &filename, const char stage[], const unsigned int value) { }
|
void reportProgress(const std::string &filename, const char stage[], const unsigned int value) { }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue