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:
Christian Stenger
2017-06-27 15:15:43 +02:00
parent 2a555a0da7
commit 625129d29c
11 changed files with 40 additions and 11 deletions

View File

@@ -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;
}