forked from qt-creator/qt-creator
Ignore the ICC lines about using or creating a PCH file
Qt Creator has been showing them as errors, but they're little more than noise in the output. Creator still doesn't understand "remark" lines from ICC, but that's something for another day. Change-Id: Ic894fe41f92a677ddbe09beb0ea4c557edeb0547 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -61,11 +61,22 @@ LinuxIccParser::LinuxIccParser()
|
|||||||
m_caretLine.setMinimal(true);
|
m_caretLine.setMinimal(true);
|
||||||
QTC_CHECK(m_caretLine.isValid());
|
QTC_CHECK(m_caretLine.isValid());
|
||||||
|
|
||||||
|
// ".pch/Qt5Core.pchi.cpp": creating precompiled header file ".pch/Qt5Core.pchi"
|
||||||
|
// "animation/qabstractanimation.cpp": using precompiled header file ".pch/Qt5Core.pchi"
|
||||||
|
m_pchInfoLine.setPattern(QLatin1String("^\".*\": (creating|using) precompiled header file \".*\"\n$"));
|
||||||
|
m_pchInfoLine.setMinimal(true);
|
||||||
|
QTC_CHECK(m_pchInfoLine.isValid());
|
||||||
|
|
||||||
appendOutputParser(new LdParser);
|
appendOutputParser(new LdParser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxIccParser::stdError(const QString &line)
|
void LinuxIccParser::stdError(const QString &line)
|
||||||
{
|
{
|
||||||
|
if (m_pchInfoLine.indexIn(line) != -1) {
|
||||||
|
// totally ignore this line
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) {
|
if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) {
|
||||||
// Clear out old task
|
// Clear out old task
|
||||||
Task::TaskType type = Task::Unknown;
|
Task::TaskType type = Task::Unknown;
|
||||||
@@ -143,6 +154,13 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
|
|||||||
<< QList<Task>()
|
<< QList<Task>()
|
||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
|
QTest::newRow("pch creation")
|
||||||
|
<< QString::fromLatin1("\".pch/Qt5Core.pchi.cpp\": creating precompiled header file \".pch/Qt5Core.pchi\"")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< QList<Task>()
|
||||||
|
<< QString();
|
||||||
|
|
||||||
QTest::newRow("undeclared function")
|
QTest::newRow("undeclared function")
|
||||||
<< QString::fromLatin1("main.cpp(13): error: identifier \"f\" is undefined\n"
|
<< QString::fromLatin1("main.cpp(13): error: identifier \"f\" is undefined\n"
|
||||||
" f(0);\n"
|
" f(0);\n"
|
||||||
@@ -157,6 +175,23 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
|
|||||||
Constants::TASK_CATEGORY_COMPILE))
|
Constants::TASK_CATEGORY_COMPILE))
|
||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
|
// same, with PCH remark
|
||||||
|
QTest::newRow("pch use+undeclared function")
|
||||||
|
<< QString::fromLatin1("\"main.cpp\": using precompiled header file \".pch/Qt5Core.pchi\"\n"
|
||||||
|
"main.cpp(13): error: identifier \"f\" is undefined\n"
|
||||||
|
" f(0);\n"
|
||||||
|
" ^\n"
|
||||||
|
"\n")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString::fromLatin1("\n")
|
||||||
|
<< (QList<Task>()
|
||||||
|
<< Task(Task::Error,
|
||||||
|
QLatin1String("identifier \"f\" is undefined\nf(0);"),
|
||||||
|
Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 13,
|
||||||
|
Constants::TASK_CATEGORY_COMPILE))
|
||||||
|
<< QString();
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("private function")
|
QTest::newRow("private function")
|
||||||
<< QString::fromLatin1("main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\n"
|
<< QString::fromLatin1("main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\n"
|
||||||
" b.privatefunc();\n"
|
" b.privatefunc();\n"
|
||||||
|
@@ -53,6 +53,7 @@ private:
|
|||||||
QRegExp m_firstLine;
|
QRegExp m_firstLine;
|
||||||
QRegExp m_continuationLines;
|
QRegExp m_continuationLines;
|
||||||
QRegExp m_caretLine;
|
QRegExp m_caretLine;
|
||||||
|
QRegExp m_pchInfoLine;
|
||||||
|
|
||||||
bool m_expectFirstLine;
|
bool m_expectFirstLine;
|
||||||
int m_indent;
|
int m_indent;
|
||||||
|
Reference in New Issue
Block a user