forked from qt-creator/qt-creator
AutoTest: Fix appending test results with the same name
If two test cases had the same name but came from a different executable the results pane still might have shown any later one (badly) cascaded inside the first one. Avoid this by providing an additional unique information (the respective executable for the test case) Task-number: QTCREATORBUG-18502 Change-Id: Ib071e389758b6269a9a90cc4c4afbcf86ca583ac Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -295,11 +295,13 @@ TestResultItem *TestResultModel::findParentItemFor(const TestResultItem *item,
|
||||
TestResultItem *root = startItem ? const_cast<TestResultItem *>(startItem) : nullptr;
|
||||
const TestResult *result = item->testResult();
|
||||
const QString &name = result->name();
|
||||
const QString &executable = result->executable();
|
||||
|
||||
if (root == nullptr && !name.isEmpty()) {
|
||||
for (int row = rootItem()->childCount() - 1; row >= 0; --row) {
|
||||
TestResultItem *tmp = static_cast<TestResultItem *>(rootItem()->childAt(row));
|
||||
if (tmp->testResult()->name() == name) {
|
||||
auto tmpTestResult = tmp->testResult();
|
||||
if (tmpTestResult->executable() == executable && tmpTestResult->name() == name) {
|
||||
root = tmp;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user