forked from qt-creator/qt-creator
Qmake: moc notes no longer are considered to be errors
Change-Id: Ifccd877d5096279f38a0084a4cb0eba0e7705d87 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -31,11 +31,12 @@ using namespace ProjectExplorer;
|
|||||||
|
|
||||||
static Task::TaskType taskType(const QString &capture)
|
static Task::TaskType taskType(const QString &capture)
|
||||||
{
|
{
|
||||||
if (capture == QLatin1String("warning"))
|
const QString lc = capture.toLower();
|
||||||
return Task::Warning;
|
if (lc == QLatin1String("error"))
|
||||||
else if (capture == QLatin1String("note"))
|
|
||||||
return Task::Unknown;
|
|
||||||
return Task::Error;
|
return Task::Error;
|
||||||
|
if (lc == QLatin1String("warning"))
|
||||||
|
return Task::Warning;
|
||||||
|
return Task::Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// opt. drive letter + filename: (2 brackets)
|
// opt. drive letter + filename: (2 brackets)
|
||||||
@@ -249,6 +250,17 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
|
|||||||
Utils::FileName(), -1,
|
Utils::FileName(), -1,
|
||||||
categoryCompile))
|
categoryCompile))
|
||||||
<< QString();
|
<< QString();
|
||||||
|
QTest::newRow("moc note")
|
||||||
|
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< 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()
|
void ProjectExplorerPlugin::testClangOutputParser()
|
||||||
|
|||||||
@@ -880,6 +880,17 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
|
|||||||
categoryCompile)
|
categoryCompile)
|
||||||
)
|
)
|
||||||
<< QString();
|
<< QString();
|
||||||
|
QTest::newRow("moc note")
|
||||||
|
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< 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()
|
void ProjectExplorerPlugin::testGccOutputParsers()
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ void LdParser::stdError(const QString &line)
|
|||||||
description.startsWith(QLatin1String("At top level")) ||
|
description.startsWith(QLatin1String("At top level")) ||
|
||||||
description.startsWith(QLatin1String("instantiated from ")) ||
|
description.startsWith(QLatin1String("instantiated from ")) ||
|
||||||
description.startsWith(QLatin1String("In ")) ||
|
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;
|
type = Task::Unknown;
|
||||||
} else if (description.startsWith(QLatin1String("warning: "), Qt::CaseInsensitive)) {
|
} else if (description.startsWith(QLatin1String("warning: "), Qt::CaseInsensitive)) {
|
||||||
type = Task::Warning;
|
type = Task::Warning;
|
||||||
|
|||||||
@@ -215,6 +215,17 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
|
|||||||
Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 41,
|
Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 41,
|
||||||
Constants::TASK_CATEGORY_COMPILE))
|
Constants::TASK_CATEGORY_COMPILE))
|
||||||
<< QString();
|
<< QString();
|
||||||
|
QTest::newRow("moc note")
|
||||||
|
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< 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()
|
void ProjectExplorerPlugin::testLinuxIccOutputParsers()
|
||||||
|
|||||||
@@ -504,6 +504,12 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
|
|||||||
Utils::FileName::fromUserInput(QLatin1String("D:\\Project\\types.h")), 71,
|
Utils::FileName::fromUserInput(QLatin1String("D:\\Project\\types.h")), 71,
|
||||||
Constants::TASK_CATEGORY_COMPILE))
|
Constants::TASK_CATEGORY_COMPILE))
|
||||||
<< QString();
|
<< 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<ProjectExplorer::Task>())
|
||||||
|
<< QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::testMsvcOutputParsers()
|
void ProjectExplorerPlugin::testMsvcOutputParsers()
|
||||||
|
|||||||
@@ -44,14 +44,21 @@ void QMakeParser::stdError(const QString &line)
|
|||||||
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;
|
||||||
|
const QString description = m_error.cap(3);
|
||||||
if (fileName.startsWith(QLatin1String("WARNING: "))) {
|
if (fileName.startsWith(QLatin1String("WARNING: "))) {
|
||||||
type = Task::Warning;
|
type = Task::Warning;
|
||||||
fileName = fileName.mid(9);
|
fileName = fileName.mid(9);
|
||||||
} else if (fileName.startsWith(QLatin1String("ERROR: "))) {
|
} else if (fileName.startsWith(QLatin1String("ERROR: "))) {
|
||||||
fileName = fileName.mid(7);
|
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,
|
Task task = Task(type,
|
||||||
m_error.cap(3) /* description */,
|
description,
|
||||||
Utils::FileName::fromUserInput(fileName),
|
Utils::FileName::fromUserInput(fileName),
|
||||||
m_error.cap(2).toInt() /* line */,
|
m_error.cap(2).toInt() /* line */,
|
||||||
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
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,
|
Utils::FileName::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1,
|
||||||
categoryBuildSystem))
|
categoryBuildSystem))
|
||||||
<< QString();
|
<< QString();
|
||||||
}
|
QTest::newRow("moc note")
|
||||||
|
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< 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()
|
void QmakeProjectManagerPlugin::testQmakeOutputParsers()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user