Commit 97cc22d6 authored by Shawn Rutledge's avatar Shawn Rutledge Committed by Tobias Hunger

QtParser handles qdoc errors too (case-insensitive error/warning)

I thought this was already working but it turns out that gccparser
was catching it instead.  That probably won't work on Windows.
https://codereview.qt-project.org/#change,35510 - qdoc will output
the text "error:" or "warning:" now so that creator will make proper
"issues" in the issue list.

Change-Id: I9db13062335c1a2325b0937e43041058510d05dd
Reviewed-by: default avatarMartin Smith <martin.smith@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 58f101cb
......@@ -41,7 +41,7 @@ using ProjectExplorer::Task;
#define FILE_PATTERN "^(([A-Za-z]:)?[^:]+\\.[^:]+)"
QtParser::QtParser() :
m_mocRegExp(QLatin1String(FILE_PATTERN"[:\\(](\\d+)\\)?:\\s(Warning|Error):\\s(.+)$"))
m_mocRegExp(QLatin1String(FILE_PATTERN"[:\\(](\\d+)\\)?:\\s([Ww]arning|[Ee]rror):\\s(.+)$"))
{
setObjectName(QLatin1String("QtParser"));
m_mocRegExp.setMinimal(true);
......@@ -60,7 +60,7 @@ void QtParser::stdError(const QString &line)
Utils::FileName::fromUserInput(m_mocRegExp.cap(1)) /* filename */,
lineno,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE));
if (m_mocRegExp.cap(4) == QLatin1String("Warning"))
if (m_mocRegExp.cap(4).compare(QLatin1String("Warning"), Qt::CaseInsensitive) == 0)
task.type = Task::Warning;
emit addTask(task);
return;
......@@ -116,6 +116,15 @@ void QtSupportPlugin::testQtOutputParser_data()
"../../scriptbug/main.cpp:22: instantiated from here\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("qdoc warning")
<< QString::fromLatin1("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp:295: warning: Can't create link to 'Object Trees & Ownership'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Can't create link to 'Object Trees & Ownership'"),
Utils::FileName::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString();
QTest::newRow("moc warning")
<< QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment