diff options
Diffstat (limited to 'src/plugins/qtsupport/qttestparser.cpp')
-rw-r--r-- | src/plugins/qtsupport/qttestparser.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/plugins/qtsupport/qttestparser.cpp b/src/plugins/qtsupport/qttestparser.cpp index 901613437e..ec9bde4dd1 100644 --- a/src/plugins/qtsupport/qttestparser.cpp +++ b/src/plugins/qtsupport/qttestparser.cpp @@ -47,8 +47,11 @@ using namespace Utils; namespace QtSupport { namespace Internal { -void QtTestParser::stdOutput(const QString &line) +OutputLineParser::Result QtTestParser::handleLine(const QString &line, OutputFormat type) { + if (type != StdOutFormat) + return Status::NotHandled; + const QString theLine = rightTrimmed(line); static const QRegularExpression triggerPattern("^(?:XPASS|FAIL!) : .+$"); QTC_CHECK(triggerPattern.isValid()); @@ -56,31 +59,33 @@ void QtTestParser::stdOutput(const QString &line) emitCurrentTask(); m_currentTask = Task(Task::Error, theLine, FilePath(), -1, Constants::TASK_CATEGORY_AUTOTEST); - return; - } - if (m_currentTask.isNull()) { - IOutputParser::stdOutput(line); - return; + return Status::InProgress; } + if (m_currentTask.isNull()) + return Status::NotHandled; static const QRegularExpression locationPattern(HostOsInfo::isWindowsHost() ? QString(QT_TEST_FAIL_WIN_REGEXP) : QString(QT_TEST_FAIL_UNIX_REGEXP)); QTC_CHECK(locationPattern.isValid()); const QRegularExpressionMatch match = locationPattern.match(theLine); if (match.hasMatch()) { - m_currentTask.file = FilePath::fromString( - QDir::fromNativeSeparators(match.captured("file"))); + LinkSpecs linkSpecs; + m_currentTask.file = absoluteFilePath(FilePath::fromString( + QDir::fromNativeSeparators(match.captured("file")))); m_currentTask.line = match.captured("line").toInt(); + addLinkSpecForAbsoluteFilePath(linkSpecs, m_currentTask.file, m_currentTask.line, match, + "file"); emitCurrentTask(); - return; + return {Status::Done, linkSpecs}; } - m_currentTask.description.append('\n').append(theLine); + m_currentTask.details.append(theLine); + return Status::InProgress; } void QtTestParser::emitCurrentTask() { if (!m_currentTask.isNull()) { - emit taskAdded(m_currentTask); + scheduleTask(m_currentTask, 1); m_currentTask.clear(); } } @@ -89,7 +94,7 @@ void QtTestParser::emitCurrentTask() void QtSupportPlugin::testQtTestOutputParser() { OutputParserTester testbench; - testbench.appendOutputParser(new QtTestParser); + testbench.addLineParser(new QtTestParser); const QString input = "random output\n" "PASS : MyTest::someTest()\n" "XPASS : MyTest::someTest()\n" |