Parser: Handle changed moc error reporting

This commit is contained in:
Tobias Hunger
2011-01-20 11:16:00 +01:00
parent 8ab2735368
commit ca73b6b95f

View File

@@ -44,13 +44,13 @@ using ProjectExplorer::Task;
namespace { namespace {
// opt. drive letter + filename: (2 brackets) // opt. drive letter + filename: (2 brackets)
const char * const FILE_PATTERN = "^(([A-Za-z]:)?[^:]+\\.[^:]+):"; const char * const FILE_PATTERN = "^(([A-Za-z]:)?[^:]+\\.[^:]+)";
} }
QtParser::QtParser() QtParser::QtParser()
{ {
setObjectName(QLatin1String("QtParser")); setObjectName(QLatin1String("QtParser"));
m_mocRegExp.setPattern(QString::fromLatin1(FILE_PATTERN) + "(\\d+):\\s(Warning|Error):\\s(.+)$"); m_mocRegExp.setPattern(QString::fromLatin1(FILE_PATTERN) + "[:\\(](\\d+)\\)?:\\s(Warning|Error):\\s(.+)$");
m_mocRegExp.setMinimal(true); m_mocRegExp.setMinimal(true);
} }
@@ -131,6 +131,15 @@ void Qt4ProjectManagerPlugin::testQtOutputParser_data()
QLatin1String("..\\untitled\\errorfile.h"), 0, QLatin1String("..\\untitled\\errorfile.h"), 0,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString(); << QString();
QTest::newRow("moc warning 2")
<< QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."),
QLatin1String("c:\\code\\test.h"), 96,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
} }
void Qt4ProjectManagerPlugin::testQtOutputParser() void Qt4ProjectManagerPlugin::testQtOutputParser()