forked from qt-creator/qt-creator
AutoTest: Use Utils::FilePath for files and directories
Still some missing bits as some QString members had different meanings depending on their context. Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -36,14 +36,10 @@
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
static QString constructSourceFilePath(const QString &path, const QString &filePath)
|
||||
{
|
||||
return QFileInfo(path, filePath).canonicalFilePath();
|
||||
}
|
||||
|
||||
GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
|
||||
QProcess *testApplication, const QString &buildDirectory,
|
||||
const QString &projectFile)
|
||||
QProcess *testApplication,
|
||||
const Utils::FilePath &buildDirectory,
|
||||
const Utils::FilePath &projectFile)
|
||||
: TestOutputReader(futureInterface, testApplication, buildDirectory)
|
||||
, m_projectFile(projectFile)
|
||||
{
|
||||
@@ -181,7 +177,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine)
|
||||
TestResultPtr testResult = createDefaultResult();
|
||||
testResult->setResult(type);
|
||||
testResult->setLine(match.captured(3).toInt());
|
||||
const QString file = constructSourceFilePath(m_buildDir, match.captured(2));
|
||||
const Utils::FilePath file = constructSourceFilePath(m_buildDir, match.captured(2));
|
||||
if (!file.isEmpty())
|
||||
testResult->setFileName(file);
|
||||
testResult->setDescription(match.captured(4));
|
||||
@@ -246,7 +242,7 @@ void GTestOutputReader::handleDescriptionAndReportResult(TestResultPtr testResul
|
||||
testResult = createDefaultResult();
|
||||
testResult->setResult(ResultType::MessageLocation);
|
||||
testResult->setLine(innerMatch.captured(2).toInt());
|
||||
QString file = constructSourceFilePath(m_buildDir, innerMatch.captured(1));
|
||||
const Utils::FilePath file = constructSourceFilePath(m_buildDir, innerMatch.captured(1));
|
||||
if (!file.isEmpty())
|
||||
testResult->setFileName(file);
|
||||
resultDescription << output;
|
||||
|
||||
Reference in New Issue
Block a user