Commit fee1b341 authored by Tobias Hunger's avatar Tobias Hunger

QMake: Fix parsing of WARNINGS

Handle qmake warnings that start with WARNING: or ERROR: but do not
contain any obvious filename.

Task-number: QTCREATORBUG-14335
Change-Id: I5b4cedbb7408c74092fb81412cc50b37e4698b7e
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent c9588aa8
......@@ -46,26 +46,6 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+):(\\d+):\\s(.+)$"))
void QMakeParser::stdError(const QString &line)
{
QString lne = rightTrimmed(line);
if (lne.startsWith(QLatin1String("Project ERROR:"))) {
const QString description = lne.mid(15);
Task task = Task(Task::Error,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
if (lne.startsWith(QLatin1String("Project WARNING:"))) {
const QString description = lne.mid(17);
Task task = Task(Task::Warning,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
if (m_error.indexIn(lne) > -1) {
QString fileName = m_error.cap(1);
Task::TaskType type = Task::Error;
......@@ -83,6 +63,28 @@ void QMakeParser::stdError(const QString &line)
emit addTask(task, 1);
return;
}
if (lne.startsWith(QLatin1String("Project ERROR: "))
|| lne.startsWith(QLatin1String("ERROR: "))) {
const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2);
Task task = Task(Task::Error,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
if (lne.startsWith(QLatin1String("Project WARNING: "))
|| lne.startsWith(QLatin1String("WARNING: "))) {
const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2);
Task task = Task(Task::Warning,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
IOutputParser::stdError(line);
}
......@@ -155,6 +157,17 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data()
categoryBuildSystem))
<< QString();
QTest::newRow("qMake warning 2")
<< QString::fromLatin1("WARNING: Failure to find: blackberrycreatepackagestepconfigwidget.cpp")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Warning,
QLatin1String("Failure to find: blackberrycreatepackagestepconfigwidget.cpp"),
Utils::FileName(), -1,
categoryBuildSystem))
<< QString();
QTest::newRow("qMake warning with location")
<< QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
<< 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