Verification; Fix testing

This commit is contained in:
Daniel Marjamäki 2019-12-28 22:09:16 +01:00
parent ad8bedebd7
commit d16ea3293e
2 changed files with 7 additions and 6 deletions

View File

@ -195,8 +195,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
else if (std::strncmp(argv[i], "--verify-report=", 16) == 0) { else if (std::strncmp(argv[i], "--verify-report=", 16) == 0) {
mSettings->verification = true; mSettings->verification = true;
mSettings->verificationReport = argv[i] + 16; mSettings->verificationReport = argv[i] + 16;
} } else if (std::strcmp(argv[i], "--debug-verify") == 0)
else if (std::strcmp(argv[i], "--debug-verify") == 0)
mSettings->debugVerification = true; mSettings->debugVerification = true;
// Enforce language (--language=, -x) // Enforce language (--language=, -x)

View File

@ -1579,14 +1579,16 @@ void ExprEngine::executeFunction(const Scope *functionScope, const Tokenizer *to
call(callbacks, tok, bailoutValue, &data); call(callbacks, tok, bailoutValue, &data);
} }
if (settings->debugVerification && !trackExecution.isAllOk()) { if (settings->debugVerification && (callbacks.empty() || !trackExecution.isAllOk())) {
if (!settings->verificationReport.empty()) if (!settings->verificationReport.empty())
report << "[debug]" << std::endl; report << "[debug]" << std::endl;
trackExecution.print(report); trackExecution.print(report);
if (!callbacks.empty()) {
if (!settings->verificationReport.empty()) if (!settings->verificationReport.empty())
report << "[details]" << std::endl; report << "[details]" << std::endl;
trackExecution.report(report, functionScope); trackExecution.report(report, functionScope);
} }
}
// Write a verification report // Write a verification report
if (!settings->verificationReport.empty()) { if (!settings->verificationReport.empty()) {