Skip to content
Snippets Groups Projects
Commit 7af0ea38 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

qmake: Improve parser

Improve qmake parser to handle yet another way it marks up warnings.

Add unit test for this case.
parent b9b85947
No related branches found
No related tags found
No related merge requests found
...@@ -69,9 +69,17 @@ void QMakeParser::stdError(const QString &line) ...@@ -69,9 +69,17 @@ void QMakeParser::stdError(const QString &line)
return; return;
} }
if (m_error.indexIn(lne) > -1) { if (m_error.indexIn(lne) > -1) {
emit addTask(Task(Task::Error, QString fileName = QDir::fromNativeSeparators(m_error.cap(1));
Task::TaskType type = Task::Error;
if (fileName.startsWith("WARNING: ")) {
type = Task::Warning;
fileName = fileName.mid(9);
} else if (fileName.startsWith("ERROR: ")) {
fileName = fileName.mid(7);
}
emit addTask(Task(type,
m_error.cap(3) /* description */, m_error.cap(3) /* description */,
QDir::fromNativeSeparators(m_error.cap(1)) /* file */, fileName,
m_error.cap(2).toInt() /* line */, m_error.cap(2).toInt() /* line */,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
return; return;
...@@ -146,6 +154,17 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data() ...@@ -146,6 +154,17 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
QString(), -1, QString(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)) ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))
<< QString(); << QString();
QTest::newRow("qMake warning with location")
<< QString::fromLatin1("WARNING: e:\\NokiaQtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Warning,
QLatin1String("Unescaped backslashes are deprecated."),
QLatin1String("e:/NokiaQtSDK/Simulator/Qt/msvc2008/lib/qtmaind.prl"), 1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))
<< QString();
} }
void Qt4ProjectManagerPlugin::testQmakeOutputParsers() void Qt4ProjectManagerPlugin::testQmakeOutputParsers()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment