From eb651f9fd6c159713fcfdb20b0074f71217b2a40 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 11 Feb 2016 11:55:00 +0100 Subject: [PATCH] Qmake: moc notes no longer are considered to be errors Change-Id: Ifccd877d5096279f38a0084a4cb0eba0e7705d87 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/clangparser.cpp | 20 ++++++++++++++---- src/plugins/projectexplorer/gccparser.cpp | 11 ++++++++++ src/plugins/projectexplorer/ldparser.cpp | 3 ++- .../projectexplorer/linuxiccparser.cpp | 11 ++++++++++ src/plugins/projectexplorer/msvcparser.cpp | 6 ++++++ .../qmakeprojectmanager/qmakeparser.cpp | 21 +++++++++++++++++-- 6 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index 56d062a46c4..b2652663765 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -31,11 +31,12 @@ using namespace ProjectExplorer; static Task::TaskType taskType(const QString &capture) { - if (capture == QLatin1String("warning")) + const QString lc = capture.toLower(); + if (lc == QLatin1String("error")) + return Task::Error; + if (lc == QLatin1String("warning")) return Task::Warning; - else if (capture == QLatin1String("note")) - return Task::Unknown; - return Task::Error; + return Task::Unknown; } // opt. drive letter + filename: (2 brackets) @@ -249,6 +250,17 @@ void ProjectExplorerPlugin::testClangOutputParser_data() Utils::FileName(), -1, categoryCompile)) << QString(); + QTest::newRow("moc note") + << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") + << OutputParserTester::STDERR + << QString() << QString() + << (QList() + << Task(Task::Unknown, + QLatin1String("Note: No relevant classes found. No output generated."), + Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + categoryCompile) + ) + << QString(); } void ProjectExplorerPlugin::testClangOutputParser() diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index e1d2e21b336..1d3f510baff 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -880,6 +880,17 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() categoryCompile) ) << QString(); + QTest::newRow("moc note") + << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") + << OutputParserTester::STDERR + << QString() << QString() + << (QList() + << Task(Task::Unknown, + QLatin1String("Note: No relevant classes found. No output generated."), + Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + categoryCompile) + ) + << QString(); } void ProjectExplorerPlugin::testGccOutputParsers() diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index b9bf56bb5e0..c903140add8 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -120,7 +120,8 @@ void LdParser::stdError(const QString &line) description.startsWith(QLatin1String("At top level")) || description.startsWith(QLatin1String("instantiated from ")) || description.startsWith(QLatin1String("In ")) || - description.startsWith(QLatin1String("first defined here"))) { + description.startsWith(QLatin1String("first defined here")) || + description.startsWith(QLatin1String("note:"), Qt::CaseInsensitive)) { type = Task::Unknown; } else if (description.startsWith(QLatin1String("warning: "), Qt::CaseInsensitive)) { type = Task::Warning; diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index c9b2750630a..4ed2e2b0776 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -215,6 +215,17 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 41, Constants::TASK_CATEGORY_COMPILE)) << QString(); + QTest::newRow("moc note") + << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") + << OutputParserTester::STDERR + << QString() << QString() + << (QList() + << Task(Task::Unknown, + QLatin1String("Note: No relevant classes found. No output generated."), + Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Constants::TASK_CATEGORY_COMPILE) + ) + << QString(); } void ProjectExplorerPlugin::testLinuxIccOutputParsers() diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index b7996ca125b..710a7e89326 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -504,6 +504,12 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() Utils::FileName::fromUserInput(QLatin1String("D:\\Project\\types.h")), 71, Constants::TASK_CATEGORY_COMPILE)) << QString(); + QTest::newRow("ignore moc note") + << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") + << OutputParserTester::STDERR + << QString() << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.\n") + << (QList()) + << QString(); } void ProjectExplorerPlugin::testMsvcOutputParsers() diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp index f91b8b2db4f..4af888cc2c4 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp @@ -44,14 +44,21 @@ void QMakeParser::stdError(const QString &line) if (m_error.indexIn(lne) > -1) { QString fileName = m_error.cap(1); Task::TaskType type = Task::Error; + const QString description = m_error.cap(3); if (fileName.startsWith(QLatin1String("WARNING: "))) { type = Task::Warning; fileName = fileName.mid(9); } else if (fileName.startsWith(QLatin1String("ERROR: "))) { fileName = fileName.mid(7); } + if (description.startsWith(QLatin1String("note:"), Qt::CaseInsensitive)) + type = Task::Unknown; + else if (description.startsWith(QLatin1String("warning:"), Qt::CaseInsensitive)) + type = Task::Warning; + else if (description.startsWith(QLatin1String("error:"), Qt::CaseInsensitive)) + type = Task::Error; Task task = Task(type, - m_error.cap(3) /* description */, + description, Utils::FileName::fromUserInput(fileName), m_error.cap(2).toInt() /* line */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); @@ -173,7 +180,17 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() Utils::FileName::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1, categoryBuildSystem)) << QString(); -} + QTest::newRow("moc note") + << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") + << OutputParserTester::STDERR + << QString() << QString() + << (QList() + << Task(Task::Unknown, + QLatin1String("Note: No relevant classes found. No output generated."), + Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + categoryBuildSystem) + ) + << QString();} void QmakeProjectManagerPlugin::testQmakeOutputParsers() {