Commit 01747388 authored by Christian Stenger's avatar Christian Stenger
Browse files

AutoTest: Pass parameter by reference and use framework id...

...for determining from which root node test cases names are needed.
Another preparation for introducing test frameworks.

Change-Id: I02910f3e4736d9be6e6822eea7863fc62252d4db
Reviewed-by: default avatarDavid Schulz <>
parent dd4e185e
......@@ -234,7 +234,7 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
void QtTestParser::init(const QStringList &filesToParse)
m_testCaseNames = TestTreeModel::instance()->testCaseNamesForFiles(filesToParse);
m_testCaseNames = TestTreeModel::instance()->testCaseNamesForFiles(id(), filesToParse);
......@@ -261,14 +261,16 @@ void TestTreeModel::sweep()
QHash<QString, QString> TestTreeModel::testCaseNamesForFiles(QStringList files)
// TODO move this function to qtest framework folder as it's only necessary there
QHash<QString, QString> TestTreeModel::testCaseNamesForFiles(const Core::Id &id,
const QStringList &files)
QHash<QString, QString> result;
if (!m_qtTestRootItem)
return result;
TestTreeItem *rootNode = rootItemForFramework(id);
QTC_ASSERT(rootNode, return result);
for (int row = 0, count = m_qtTestRootItem->childCount(); row < count; ++row) {
const TestTreeItem *child = m_qtTestRootItem->childItem(row);
for (int row = 0, count = rootNode->childCount(); row < count; ++row) {
const TestTreeItem *child = rootNode->childItem(row);
if (files.contains(child->filePath())) {
result.insert(child->filePath(), child->name());
......@@ -73,7 +73,7 @@ public:
void markAllForRemoval();
void markForRemoval(const QString &filePath);
void sweep();
QHash<QString, QString> testCaseNamesForFiles(QStringList files);
QHash<QString, QString> testCaseNamesForFiles(const Core::Id &id, const QStringList &files);
void testTreeModelChanged();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment