summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2017-06-27 11:04:21 +0200
committerChristian Stenger <christian.stenger@qt.io>2017-06-27 13:14:12 +0000
commita72b38b8c9f26c375ee0e6e348d4c3a32af16c25 (patch)
treee8f5ea0ca1e3551f4f10ac28597c9db3816090db
parent56db0df2e65f897a6d268a6e8e22bb543a56215d (diff)
downloadqt-creator-a72b38b8c9f26c375ee0e6e348d4c3a32af16c25.tar.gz
AutoTest: Improve finding executables for cmake based projects
Depending on the structure of a project we might end up inside a library and will not find the correct executable for running a test. This patch improves finding the correct executable, but depending on the complexity of the project it will not be able to fix all circumstances. Task-number: QTCREATORBUG-17882 Change-Id: I847bb40426bc1b874c2dc6a2a6880b11fe048bda Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/autotest/gtest/gtesttreeitem.cpp12
-rw-r--r--src/plugins/autotest/gtest/gtesttreeitem.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp
index dc53bd21dd..cd201cb9a4 100644
--- a/src/plugins/autotest/gtest/gtesttreeitem.cpp
+++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp
@@ -327,5 +327,17 @@ QString GTestTreeItem::nameSuffix() const
return suffix;
}
+QSet<QString> GTestTreeItem::internalTargets() const
+{
+ QSet<QString> result;
+ const auto cppMM = CppTools::CppModelManager::instance();
+ const auto projectInfo = cppMM->projectInfo(ProjectExplorer::SessionManager::startupProject());
+ for (const CppTools::ProjectPart::Ptr projectPart : projectInfo.projectParts()) {
+ if (projectPart->projectFile == proFile())
+ result.insert(projectPart->buildSystemTarget);
+ }
+ return result;
+}
+
} // namespace Internal
} // namespace Autotest
diff --git a/src/plugins/autotest/gtest/gtesttreeitem.h b/src/plugins/autotest/gtest/gtesttreeitem.h
index 67973771dd..60eb37b7f2 100644
--- a/src/plugins/autotest/gtest/gtesttreeitem.h
+++ b/src/plugins/autotest/gtest/gtesttreeitem.h
@@ -67,6 +67,7 @@ public:
GTestTreeItem::TestStates state,
const QString &proFile) const;
QString nameSuffix() const;
+ QSet<QString> internalTargets() const override;
private:
GTestTreeItem::TestStates m_state;