forked from qt-creator/qt-creator
AutoTest: Fix retrieval of build system target
If we failed to find a project part for the respective file it is most likely that we had a header with declarations only but we can still find depending targets for this file. Task-number: QTCREATORBUG-18922 Change-Id: I80d0af569bbd6c2a41bf498fb55283704f16439c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -288,6 +288,9 @@ QSet<QString> TestTreeItem::internalTargets() const
|
||||
{
|
||||
auto cppMM = CppTools::CppModelManager::instance();
|
||||
const QList<CppTools::ProjectPart::Ptr> projectParts = cppMM->projectPart(m_filePath);
|
||||
// if we have no project parts it's most likely a header with declarations only and CMake based
|
||||
if (projectParts.isEmpty())
|
||||
return TestTreeItem::dependingInternalTargets(cppMM, m_filePath);
|
||||
QSet<QString> targets;
|
||||
for (const CppTools::ProjectPart::Ptr part : projectParts) {
|
||||
targets.insert(part->buildSystemTarget + '|' + part->projectFile);
|
||||
|
||||
Reference in New Issue
Block a user