AutoTest: Further adaption following official terms

GoogleTest started using the term Test Suite for grouping
related tests and Test Case for general tests.
This patch adapts the visual strings as well as some
internal API which used the same terms.
This completes 6189745a3b.

Change-Id: I0307c10b8b5f8574f31a68ee4320732f3e829532
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-05-24 07:17:50 +02:00
parent d8ab335e51
commit 5c6eb0a2ba
7 changed files with 38 additions and 45 deletions

View File

@@ -46,7 +46,7 @@ const QString GTestResult::outputString(bool selected) const
switch (result()) {
case ResultType::Pass:
case ResultType::Fail:
output = m_testSetName;
output = m_testCaseName;
if (selected && !desc.isEmpty())
output.append('\n').append(desc);
break;
@@ -64,14 +64,14 @@ bool GTestResult::isDirectParentOf(const TestResult *other, bool *needsIntermedi
return false;
const GTestResult *gtOther = static_cast<const GTestResult *>(other);
if (m_testSetName == gtOther->m_testSetName) {
if (m_testCaseName == gtOther->m_testCaseName) {
const ResultType otherResult = other->result();
if (otherResult == ResultType::MessageInternal || otherResult == ResultType::MessageLocation)
return result() != ResultType::MessageInternal && result() != ResultType::MessageLocation;
}
if (m_iteration != gtOther->m_iteration)
return false;
return isTest() && gtOther->isTestSet();
return isTestSuite() && gtOther->isTestCase();
}
static QString normalizeName(const QString &name)
@@ -110,22 +110,22 @@ bool GTestResult::matches(const TestTreeItem *treeItem) const
if (treeItem->proFile() != m_projectFile)
return false;
if (isTest())
return matchesTestCase(treeItem);
if (isTestSuite())
return matchesTestSuite(treeItem);
return matchesTestFunctionOrSet(treeItem);
return matchesTestCase(treeItem);
}
bool GTestResult::matchesTestFunctionOrSet(const TestTreeItem *treeItem) const
bool GTestResult::matchesTestCase(const TestTreeItem *treeItem) const
{
if (treeItem->type() != TestTreeItem::TestCase)
return false;
const QString testItemTestSet = treeItem->parentItem()->name() + '.' + treeItem->name();
return testItemTestSet == normalizeName(m_testSetName);
const QString testItemTestCase = treeItem->parentItem()->name() + '.' + treeItem->name();
return testItemTestCase == normalizeName(m_testCaseName);
}
bool GTestResult::matchesTestCase(const TestTreeItem *treeItem) const
bool GTestResult::matchesTestSuite(const TestTreeItem *treeItem) const
{
if (treeItem->type() != TestTreeItem::TestSuite)
return false;