diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 49358f49ebd..f721ce3bc0d 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -375,8 +375,14 @@ QSet internalTargets(const FilePath &proFile) for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) { if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable) continue; - if (projectPart->projectFile == proFile.toString()) + if (projectPart->projectFile != proFile.toString()) + continue; + if (Utils::anyOf(projectPart->projectMacros, [](const ProjectExplorer::Macro ¯o){ + return macro.type == ProjectExplorer::MacroType::Define && + macro.key == "QUICK_TEST_SOURCE_DIR"; + })) { result.insert(projectPart->buildSystemTarget); + } } return result; }