forked from qt-creator/qt-creator
qmake: Improve parser
Improve qmake parser to handle yet another way it marks up warnings. Add unit test for this case.
This commit is contained in:
@@ -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()
|
|||||||
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user