GCC: Parse "In file included from blahy:"

Parse "In file included from blahy:" correctly: Newer Gccs output
additional column information there.

Change-Id: I5fe2be72ce09390c0f1370fd9b72c900279d3207
Reviewed-on: http://codereview.qt.nokia.com/2188
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Tobias Hunger
2011-07-26 11:05:59 +00:00
parent e78bc71851
commit 8275ab0f6e

View File

@@ -39,7 +39,7 @@ using namespace ProjectExplorer;
namespace {
// opt. drive letter + filename: (2 brackets)
const char * const FILE_PATTERN = "(<command line>|([A-Za-z]:)?[^:]+\\.[^:]+):";
const char * const FILE_PATTERN = "(<command[ -]line>|([A-Za-z]:)?[^:]+\\.[^:]+):";
const char * const COMMAND_PATTERN = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(gcc|g\\+\\+)(-[0-9\\.]+)?(\\.exe)?: ";
}
@@ -49,7 +49,7 @@ GccParser::GccParser()
m_regExp.setPattern(QString(QChar('^')) + QString::fromLatin1(FILE_PATTERN) + QLatin1String("(\\d+):(\\d+:)?\\s((fatal |#)?(warning|error|note):?\\s)(.+)$"));
m_regExp.setMinimal(true);
m_regExpIncluded.setPattern(QString::fromLatin1("^.*from\\s") + QString::fromLatin1(FILE_PATTERN) + QLatin1String("(\\d+)[,:]?$"));
m_regExpIncluded.setPattern(QString::fromLatin1("\\bfrom\\s") + QString::fromLatin1(FILE_PATTERN) + QLatin1String("(\\d+)(:\\d+)?[,:]?$"));
m_regExpIncluded.setMinimal(true);
// optional path with trailing slash
@@ -635,6 +635,27 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
QLatin1String("../../../src/shared/proparser/profileevaluator.cpp"), 2817,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
/*
In file included from <command-line>:0:0:
./mw.h:4:0: warning: "STUPID_DEFINE" redefined
*/
QTest::newRow("include with line:column info")
<< QString::fromLatin1("In file included from <command-line>:0:0:\n"
"./mw.h:4:0: warning: \"STUPID_DEFINE\" redefined")
<< OutputParserTester::STDERR
<< QString() << QString()
<< ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown,
QLatin1String("In file included from <command-line>:0:0:"),
QLatin1String("<command-line>"), 0,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Warning,
QLatin1String("\"STUPID_DEFINE\" redefined"),
QLatin1String("./mw.h"), 4,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
}
void ProjectExplorerPlugin::testGccOutputParsers()