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,17 +197,19 @@ bool ClangStaticAnalyzerPreconfiguredSessionTests::switchToProjectAndTarget(Proj
|
|||||||
if (project == activeProject && target == activeProject->activeTarget())
|
if (project == activeProject && target == activeProject->activeTarget())
|
||||||
return true; // OK, desired project/target already active.
|
return true; // OK, desired project/target already active.
|
||||||
|
|
||||||
QSignalSpy waitUntilProjectUpdated(CppModelManager::instance(),
|
|
||||||
&CppModelManager::projectPartsUpdated);
|
|
||||||
|
|
||||||
if (project != activeProject)
|
if (project != activeProject)
|
||||||
m_sessionManager.setStartupProject(project);
|
m_sessionManager.setStartupProject(project);
|
||||||
m_sessionManager.setActiveTarget(project, target, ProjectExplorer::SetActive::NoCascade);
|
|
||||||
|
|
||||||
const bool waitResult = waitUntilProjectUpdated.wait(30000);
|
if (target != project->activeTarget()) {
|
||||||
if (!waitResult) {
|
QSignalSpy waitUntilProjectUpdated(CppModelManager::instance(),
|
||||||
qWarning() << "waitUntilProjectUpdated() failed";
|
&CppModelManager::projectPartsUpdated);
|
||||||
return false;
|
m_sessionManager.setActiveTarget(project, target, ProjectExplorer::SetActive::NoCascade);
|
||||||
|
|
||||||
|
const bool waitResult = waitUntilProjectUpdated.wait(30000);
|
||||||
|
if (!waitResult) {
|
||||||
|
qWarning() << "waitUntilProjectUpdated() failed";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user