Commit 74734690 authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by Nikolai Kosjar
Browse files

ClangStaticAnalyzer: Tests: Change target only if necessary



...otherwise we wait for nothing.

Change-Id: Ia55d4845f8dd0fe746ee6c8ca19b5312879294d1
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 028018dc
......@@ -197,17 +197,19 @@ bool ClangStaticAnalyzerPreconfiguredSessionTests::switchToProjectAndTarget(Proj
if (project == activeProject && target == activeProject->activeTarget())
return true; // OK, desired project/target already active.
QSignalSpy waitUntilProjectUpdated(CppModelManager::instance(),
&CppModelManager::projectPartsUpdated);
if (project != activeProject)
m_sessionManager.setStartupProject(project);
m_sessionManager.setActiveTarget(project, target, ProjectExplorer::SetActive::NoCascade);
const bool waitResult = waitUntilProjectUpdated.wait(30000);
if (!waitResult) {
qWarning() << "waitUntilProjectUpdated() failed";
return false;
if (target != project->activeTarget()) {
QSignalSpy waitUntilProjectUpdated(CppModelManager::instance(),
&CppModelManager::projectPartsUpdated);
m_sessionManager.setActiveTarget(project, target, ProjectExplorer::SetActive::NoCascade);
const bool waitResult = waitUntilProjectUpdated.wait(30000);
if (!waitResult) {
qWarning() << "waitUntilProjectUpdated() failed";
return false;
}
}
return true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment