AutoTest: Fix constructing of source file path

Changes in Utils::FilePath need some adjustments to fix the
expected behavior.

Fixes: QTCREATORBUG-25979
Change-Id: Ife35a68458db9ae7c08637687a3fc9acd7d058e9
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2021-07-08 13:23:44 +02:00
parent 7b7fb9f6c7
commit f922d22ad4
2 changed files with 7 additions and 9 deletions

View File

@@ -179,7 +179,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine)
testResult->setResult(type);
testResult->setLine(match.captured(3).toInt());
const Utils::FilePath file = constructSourceFilePath(m_buildDir, match.captured(2));
if (!file.isEmpty())
if (file.exists())
testResult->setFileName(file);
testResult->setDescription(match.captured(4));
reportResult(testResult);
@@ -247,7 +247,7 @@ void GTestOutputReader::handleDescriptionAndReportResult(TestResultPtr testResul
testResult->setResult(ResultType::MessageLocation);
testResult->setLine(innerMatch.captured(2).toInt());
const Utils::FilePath file = constructSourceFilePath(m_buildDir, innerMatch.captured(1));
if (!file.isEmpty())
if (file.exists())
testResult->setFileName(file);
resultDescription << output;
}