AutoTest: Fix flakyness of plugin test

Relying on the order of tests of the underlying tree
model is bad as we order the model for the user with a
QSortFilterProxyModel.
Using non-unique keys is not wise either.
Ensure the keys are unique to have reliable results.

Change-Id: I556371d018c16e7b03a8ec85d60afc850056a94a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-03-25 16:29:04 +01:00
parent 9414961206
commit ca82019cf0
3 changed files with 24 additions and 13 deletions

View File

@@ -615,13 +615,13 @@ int TestTreeModel::boostTestNamesCount() const
return rootNode ? rootNode->childCount() : 0;
}
QMultiMap<QString, int> TestTreeModel::boostTestSuitesAndTests() const
QMap<QString, int> TestTreeModel::boostTestSuitesAndTests() const
{
QMultiMap<QString, int> result;
QMap<QString, int> result;
if (TestTreeItem *rootNode = boostTestRootNode()) {
rootNode->forFirstLevelChildren([&result](TestTreeItem *child) {
result.insert(child->name(), child->childCount());
result.insert(child->name() + '|' + child->proFile(), child->childCount());
});
}
return result;