Avoid executing unnamed Quick Tests if no related main is executed anyway

Change-Id: I521065577c195713bc252e6762a88011996f045c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-01-07 09:33:57 +01:00
parent ba8979d066
commit 35939ac402
3 changed files with 13 additions and 1 deletions

View File

@@ -465,6 +465,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
} else {
TestConfiguration *tc = new TestConfiguration(QString(), QStringList());
tc->setTestCaseCount(1);
tc->setUnnamedOnly(true);
addProjectInformation(tc, mainFile);
foundMains.insert(mainFile, tc);
}
@@ -499,6 +500,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
// unnamed test case
if (oldFunctions.size() == 0) {
tc->setTestCaseCount(tc->testCaseCount() + testFunctions.size());
tc->setUnnamedOnly(false);
} else {
oldFunctions << testFunctions;
tc->setTestCases(oldFunctions);
@@ -513,7 +515,8 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
}
foreach (TestConfiguration *config, foundMains.values())
result << config;
if (!config->unnamedOnly())
result << config;
return result;
}