Fix wrong behavior for gathering test configuration

If the current project mixed named and unnamed Quick tests
determing the test configuration failed due to running into
the assert if you had no auto tests for the current project
selected as well.

Change-Id: I5c98316fada704cd7e021becab897d168a19b99b
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-02-05 13:32:00 +01:00
parent 2ece8b6181
commit 61c50e4aa3

View File

@@ -464,13 +464,13 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
QTC_ASSERT(testConfiguration,
qWarning() << "Illegal state (unnamed Quick Test listed as named)";
return QList<TestConfiguration *>());
foundMains[mainFile]->setTestCaseCount(testConfiguration->testCaseCount());
foundMains[mainFile]->setTestCaseCount(testConfiguration->testCaseCount() + 1);
} else {
TestConfiguration *tc = new TestConfiguration(QString(), QStringList());
tc->setTestCaseCount(1);
tc->setUnnamedOnly(true);
addProjectInformation(tc, mainFile);
foundMains.insert(mainFile, tc);
testConfiguration = new TestConfiguration(QString(), QStringList());
testConfiguration->setTestCaseCount(1);
testConfiguration->setUnnamedOnly(true);
addProjectInformation(testConfiguration, mainFile);
foundMains.insert(mainFile, testConfiguration);
}
}
}