AutoTest: Correct completing test run configuration

Ensure all possible project parts are taken into account
when gathering build system targets.
When having multiple possible build system targets for a
test - which may easily happen e.g. when defining tests
beside the main application inside a big top-level
CMakeLists.txt - let the user decide which one to run.

Fixes: QTCREATORBUG-24268
Change-Id: Ia7b7e4148fe8e8dab55832c435f12cc78f5c2f7a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-07-01 17:01:10 +02:00
parent cd1a848e16
commit 502ad9badb
2 changed files with 11 additions and 12 deletions

View File

@@ -420,10 +420,8 @@ QSet<QString> QuickTestTreeItem::internalTargets() const
for (const CppTools::ProjectPart::Ptr &projectPart : projectInfo.projectParts()) {
if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable)
continue;
if (projectPart->projectFile == proFile()) {
if (projectPart->projectFile == proFile())
result.insert(projectPart->buildSystemTarget);
break;
}
}
return result;
}