AutoTest: Limit search for test tree items to respective root

If searching for a test tree item matching a QtTestResult
we can safely limit searching to the subtree holding
QtTests or QuickTests.
Additionally store information whether it is a Quick or
pure Qt test into the result to limit it to a single root.

Change-Id: I240e778448d99434d188d90a110dfa4f1934c950
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2017-10-25 14:31:57 +02:00
parent eaf4b67461
commit e412a800b0
9 changed files with 66 additions and 26 deletions

View File

@@ -131,11 +131,12 @@ static QString constructSourceFilePath(const QString &path, const QString &fileP
QtTestOutputReader::QtTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
QProcess *testApplication, const QString &buildDirectory,
const QString &projectFile, OutputMode mode)
const QString &projectFile, OutputMode mode, TestType type)
: TestOutputReader(futureInterface, testApplication, buildDirectory)
, m_executable(testApplication ? testApplication->program() : QString())
, m_projectFile(projectFile)
, m_mode(mode)
, m_testType(type)
{
}
@@ -417,7 +418,7 @@ void QtTestOutputReader::processSummaryFinishOutput()
QtTestResult *QtTestOutputReader::createDefaultResult() const
{
QtTestResult *result = new QtTestResult(m_executable, m_projectFile, m_className);
QtTestResult *result = new QtTestResult(m_executable, m_projectFile, m_testType, m_className);
result->setFunctionName(m_testCase);
result->setDataTag(m_dataTag);
return result;
@@ -444,7 +445,7 @@ void QtTestOutputReader::sendCompleteInformation()
void QtTestOutputReader::sendMessageCurrentTest()
{
TestResultPtr testResult = TestResultPtr(new QtTestResult(m_projectFile));
TestResultPtr testResult = TestResultPtr(new QtTestResult(m_projectFile, m_testType));
testResult->setResult(Result::MessageCurrentTest);
testResult->setDescription(tr("Entering test function %1::%2").arg(m_className, m_testCase));
reportResult(testResult);