Add capability to run gtest related tests

For now this only applies for 'Run All'. To be able to run only
selected tests we first have to introduce the check state for
gtest related items as well.

Change-Id: I196b56b7fe426f846f2be0df7e21458c2733cbd1
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-12-09 09:46:33 +01:00
parent db0ff4f940
commit 650be0e496
11 changed files with 228 additions and 43 deletions

View File

@@ -460,6 +460,7 @@ static TestTreeItem *constructTestTreeItem(const QString &fileName,
}
static TestTreeItem *constructGTestTreeItem(const QString &filePath, const QString &caseName,
const QString &proFile,
const TestCodeLocationList &testNames)
{
TestTreeItem *item = new TestTreeItem(caseName, QString(), TestTreeItem::GTestCase);
@@ -468,6 +469,7 @@ static TestTreeItem *constructGTestTreeItem(const QString &filePath, const QStri
locationAndType.m_type);
treeItemChild->setLine(locationAndType.m_line);
treeItemChild->setColumn(locationAndType.m_column);
treeItemChild->setMainFile(proFile);
item->appendChild(treeItemChild);
}
return item;
@@ -1030,7 +1032,7 @@ void TestCodeParser::updateGTests(const CPlusPlus::Document::Ptr &doc,
proFile = ppList.at(0)->projectFile;
foreach (const QString &testName, tests.keys()) {
TestTreeItem *item = constructGTestTreeItem(fileName, testName, tests.value(testName));
TestTreeItem *item = constructGTestTreeItem(fileName, testName, proFile, tests.value(testName));
TestInfo info(item->name(), item->getChildNames(), doc->revision(), doc->editorRevision());
info.setProfile(proFile);
foreach (const TestCodeLocationAndType &testSet, tests.value(testName)) {