forked from qt-creator/qt-creator
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: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -46,26 +46,6 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+):(\\d+):\\s(.+)$"))
|
|||||||
void QMakeParser::stdError(const QString &line)
|
void QMakeParser::stdError(const QString &line)
|
||||||
{
|
{
|
||||||
QString lne = rightTrimmed(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) {
|
if (m_error.indexIn(lne) > -1) {
|
||||||
QString fileName = m_error.cap(1);
|
QString fileName = m_error.cap(1);
|
||||||
Task::TaskType type = Task::Error;
|
Task::TaskType type = Task::Error;
|
||||||
@@ -83,6 +63,28 @@ void QMakeParser::stdError(const QString &line)
|
|||||||
emit addTask(task, 1);
|
emit addTask(task, 1);
|
||||||
return;
|
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);
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +157,17 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data()
|
|||||||
categoryBuildSystem))
|
categoryBuildSystem))
|
||||||
<< QString();
|
<< 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")
|
QTest::newRow("qMake warning with location")
|
||||||
<< QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
|
<< QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
|
||||||
<< OutputParserTester::STDERR
|
<< OutputParserTester::STDERR
|
||||||
|
|||||||
Reference in New Issue
Block a user