forked from qt-creator/qt-creator
ClangStaticAnalyzer: Tests: Change target only if necessary
...otherwise we wait for nothing. Change-Id: Ia55d4845f8dd0fe746ee6c8ca19b5312879294d1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
Nikolai Kosjar
parent
028018dcac
commit
7473469005
@@ -197,11 +197,12 @@ 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);
|
||||
|
||||
if (target != project->activeTarget()) {
|
||||
QSignalSpy waitUntilProjectUpdated(CppModelManager::instance(),
|
||||
&CppModelManager::projectPartsUpdated);
|
||||
m_sessionManager.setActiveTarget(project, target, ProjectExplorer::SetActive::NoCascade);
|
||||
|
||||
const bool waitResult = waitUntilProjectUpdated.wait(30000);
|
||||
@@ -209,6 +210,7 @@ bool ClangStaticAnalyzerPreconfiguredSessionTests::switchToProjectAndTarget(Proj
|
||||
qWarning() << "waitUntilProjectUpdated() failed";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user