diff --git a/src/plugins/autotest/qtest/qttestoutputreader.cpp b/src/plugins/autotest/qtest/qttestoutputreader.cpp index 2f309da5f37..1d1b1503818 100644 --- a/src/plugins/autotest/qtest/qttestoutputreader.cpp +++ b/src/plugins/autotest/qtest/qttestoutputreader.cpp @@ -351,9 +351,9 @@ void QtTestOutputReader::processPlainTextOutput(const QByteArray &outputLine) if (hasMatch(result)) { processResultOutput(match.captured(1).toLower().trimmed(), match.captured(2)); } else if (hasMatch(locationUnix)) { - processLocationOutput(match.captured(1)); + processLocationOutput(match.captured("file"), match.captured("line")); } else if (hasMatch(locationWin)) { - processLocationOutput(match.captured(1)); + processLocationOutput(match.captured("file"), match.captured("line")); } else if (hasMatch(benchDetails)) { m_description = match.captured(1); } else if (hasMatch(config)) { @@ -412,15 +412,11 @@ void QtTestOutputReader::processResultOutput(const QString &result, const QStrin m_formerTestCase = m_testCase; } -void QtTestOutputReader::processLocationOutput(const QString &fileWithLine) +void QtTestOutputReader::processLocationOutput(const QStringView file, const QStringView line) { - QTC_ASSERT(fileWithLine.endsWith(')'), return); - int openBrace = fileWithLine.lastIndexOf('('); - QTC_ASSERT(openBrace != -1, return); - m_file = constructSourceFilePath(m_buildDir, fileWithLine.left(openBrace)); - QString numberStr = fileWithLine.mid(openBrace + 1); - numberStr.chop(1); - m_lineNumber = numberStr.toInt(); + QTC_ASSERT(!file.isEmpty(), return); + m_file = constructSourceFilePath(m_buildDir, file.toString()); + m_lineNumber = line.toInt(); } void QtTestOutputReader::processSummaryFinishOutput() diff --git a/src/plugins/autotest/qtest/qttestoutputreader.h b/src/plugins/autotest/qtest/qttestoutputreader.h index 0962c8d6845..d09f3d56116 100644 --- a/src/plugins/autotest/qtest/qttestoutputreader.h +++ b/src/plugins/autotest/qtest/qttestoutputreader.h @@ -33,7 +33,7 @@ private: void processXMLOutput(const QByteArray &outputLine); void processPlainTextOutput(const QByteArray &outputLine); void processResultOutput(const QString &result, const QString &message); - void processLocationOutput(const QString &fileWithLine); + void processLocationOutput(const QStringView file, const QStringView line); void processSummaryFinishOutput(); // helper functions void sendCompleteInformation();