Commit 5a75b87b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

OutputParser: Treat ranlib warnings as warnings



Task-number: QTCREATORBUG-13111
Change-Id: Ifead2f7fa8d00eb044894b6d9ef0e7626e13f867
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 8b0a07f6
......@@ -88,7 +88,6 @@ void GccParser::stdError(const QString &line)
}
QRegularExpressionMatch match = m_regExpGccNames.match(lne);
if (match.hasMatch()) {
QString description = lne.mid(match.capturedLength());
Task::TaskType type = Task::Error;
......@@ -458,12 +457,6 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n")
<< QList<Task>()
<< QString();
QTest::newRow("ranlib false positive")
<< QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols\n")
<< QList<Task>()
<< QString();
QTest::newRow("ld: missing library")
<< QString::fromLatin1("/usr/bin/ld: cannot find -ldoesnotexist")
<< OutputParserTester::STDERR
......@@ -866,6 +859,29 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
categoryCompile)
)
<< QString();
QTest::newRow("Mac: ranlib warning")
<< QString::fromLatin1("ranlib: file: lib/libtest.a(Test0.cpp.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<Task>()
<< Task(Task::Warning,
QLatin1String("file: lib/libtest.a(Test0.cpp.o) has no symbols"),
Utils::FileName(), -1,
categoryCompile)
)
<< QString();
QTest::newRow("Mac: ranlib warning2")
<< QString::fromLatin1("/path/to/XCode/and/ranlib: file: lib/libtest.a(Test0.cpp.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<Task>()
<< Task(Task::Warning,
QLatin1String("file: lib/libtest.a(Test0.cpp.o) has no symbols"),
Utils::FileName(), -1,
categoryCompile)
)
<< QString();
}
void ProjectExplorerPlugin::testGccOutputParsers()
......
......@@ -42,11 +42,14 @@ namespace {
// line no. or elf segment + offset (1 bracket)
const char * const POSITION_PATTERN = "(\\d+|\\(\\..+?[+-]0x[a-fA-F0-9]+\\)):";
const char * const COMMAND_PATTERN = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(ld|gold)(-[0-9\\.]+)?(\\.exe)?: ";
const char *const RANLIB_PATTERN = "ranlib(.exe)?: (file: (.*) has no symbols)$";
}
LdParser::LdParser()
{
setObjectName(QLatin1String("LdParser"));
m_ranlib.setPattern(QLatin1String(RANLIB_PATTERN));
QTC_CHECK(m_ranlib.isValid());
m_regExpLinker.setPattern(QLatin1Char('^') +
QString::fromLatin1(FILE_PATTERN) + QLatin1Char('(') +
QString::fromLatin1(FILE_PATTERN) + QLatin1String(")?(") +
......@@ -76,7 +79,17 @@ void LdParser::stdError(const QString &line)
return;
}
QRegularExpressionMatch match = m_regExpGccNames.match(lne);
QRegularExpressionMatch match = m_ranlib.match(lne);
if (match.hasMatch()) {
QString description = match.captured(2);
Task task(Task::Warning, description,
Utils::FileName(), -1,
Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
return;
}
match = m_regExpGccNames.match(lne);
if (match.hasMatch()) {
QString description = lne.mid(match.capturedLength());
Task::TaskType type = Task::Error;
......
......@@ -46,6 +46,7 @@ public:
void stdError(const QString &line);
private:
QRegularExpression m_ranlib;
QRegularExpression m_regExpLinker;
QRegularExpression m_regExpGccNames;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment