Autotest: Keep track of generating framework in TestTreeItem

... and TestConfiguration. This allows dropping code that
reconstruct framework ids and framework lookup by id.

Change-Id: I0bb1e6e135376e21f96b9fab7971aa097787e483
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-03-26 10:11:39 +01:00
parent 223281222d
commit 77c4caf4ea
36 changed files with 117 additions and 106 deletions

View File

@@ -40,7 +40,7 @@ namespace Internal {
TestTreeItem *BoostTestTreeItem::copyWithoutChildren()
{
BoostTestTreeItem *copied = new BoostTestTreeItem;
BoostTestTreeItem *copied = new BoostTestTreeItem(framework());
copied->copyBasicDataFrom(this);
copied->m_state = m_state;
copied->m_fullName = m_fullName;
@@ -146,7 +146,7 @@ TestTreeItem *BoostTestTreeItem::createParentGroupNode() const
{
const QFileInfo fileInfo(filePath());
const QFileInfo base(fileInfo.absolutePath());
return new BoostTestTreeItem(base.baseName(), fileInfo.absolutePath(), TestTreeItem::GroupNode);
return new BoostTestTreeItem(framework(), base.baseName(), fileInfo.absolutePath(), TestTreeItem::GroupNode);
}
QString BoostTestTreeItem::prependWithParentsSuitePaths(const QString &testName) const
@@ -204,7 +204,7 @@ QList<TestConfiguration *> BoostTestTreeItem::getAllTestConfigurations() const
for (auto it = testsPerProjectfile.begin(), end = testsPerProjectfile.end(); it != end; ++it) {
for (const QString &target : qAsConst(it.value().internalTargets)) {
BoostTestConfiguration *config = new BoostTestConfiguration;
BoostTestConfiguration *config = new BoostTestConfiguration(framework());
config->setProject(project);
config->setProjectFile(it.key());
config->setTestCaseCount(it.value().testCases);
@@ -250,7 +250,7 @@ QList<TestConfiguration *> BoostTestTreeItem::getSelectedTestConfigurations() co
auto end = testCasesForProjectFile.cend();
for (auto it = testCasesForProjectFile.cbegin(); it != end; ++it) {
for (const QString &target : it.value().internalTargets) {
BoostTestConfiguration *config = new BoostTestConfiguration;
BoostTestConfiguration *config = new BoostTestConfiguration(framework());
config->setProject(project);
config->setProjectFile(it.key());
config->setTestCases(it.value().testCases);
@@ -294,7 +294,7 @@ TestConfiguration *BoostTestTreeItem::testConfiguration() const
testCases.append(prependWithParentsSuitePaths(handleSpecialFunctionNames(tcName)));
}
BoostTestConfiguration *config = new BoostTestConfiguration;
BoostTestConfiguration *config = new BoostTestConfiguration(framework());
config->setProjectFile(proFile());
config->setProject(project);
config->setTestCases(testCases);