forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user