Unit tests: Explicitly check for success from runner.

We will otherwise miss runner failures for any file that does not
contribute to the diagnostics count.
Note: The tool can also fail during the building stage, but in this case
we will get notified by the signal spy timing out.

Change-Id: Ia9aa797d658b1752e3da6e08a652ee55868955ba
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-05-04 14:57:03 +02:00
parent 5a493ae38f
commit 59e01e2a89
5 changed files with 14 additions and 8 deletions

View File

@@ -228,10 +228,10 @@ void ClangStaticAnalyzerTool::startTool()
m_diagnosticModel->clear();
setBusyCursor(true);
Project *project = SessionManager::startupProject();
QTC_ASSERT(project, return);
QTC_ASSERT(project, emit finished(false); return);
m_diagnosticFilterModel->setProject(project);
m_projectInfoBeforeBuild = CppTools::CppModelManager::instance()->projectInfo(project);
QTC_ASSERT(m_projectInfoBeforeBuild.isValid(), return);
QTC_ASSERT(m_projectInfoBeforeBuild.isValid(), emit finished(false); return);
m_running = true;
handleStateUpdate();
@@ -284,7 +284,7 @@ void ClangStaticAnalyzerTool::onEngineFinished()
resetCursorAndProjectInfoBeforeBuild();
m_running = false;
handleStateUpdate();
emit finished();
emit finished(static_cast<ClangStaticAnalyzerRunControl *>(sender())->success());
}
void ClangStaticAnalyzerTool::setBusyCursor(bool busy)