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

@@ -35,6 +35,11 @@ QtTestResult::QtTestResult(const QString &className)
{
}
QtTestResult::QtTestResult(const QString &executable, const QString &className)
: TestResult(executable, className)
{
}
const QString QtTestResult::outputString(bool selected) const
{
const QString &desc = description();
@@ -101,14 +106,14 @@ bool QtTestResult::isIntermediateFor(const TestResult *other) const
QTC_ASSERT(other, return false);
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
return m_dataTag == qtOther->m_dataTag && m_function == qtOther->m_function
&& name() == qtOther->name();
&& name() == qtOther->name() && executable() == qtOther->executable();
}
TestResult *QtTestResult::createIntermediateResultFor(const TestResult *other)
{
QTC_ASSERT(other, return nullptr);
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
QtTestResult *intermediate = new QtTestResult(qtOther->name());
QtTestResult *intermediate = new QtTestResult(qtOther->executable(), qtOther->name());
intermediate->m_function = qtOther->m_function;
intermediate->m_dataTag = qtOther->m_dataTag;
// intermediates will be needed only for data tags