BareMetal: Handle missed SDCC compiler errors

... in a form like:

 main.c:11:21: error: macro "usb_disconnect" passed 1 arguments, but takes just 0

Fixes: QTCREATORBUG-23085
Change-Id: I749539881606d27aa0cd4c2fc1c136484d13976c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Denis Shienkov
2019-10-13 18:53:09 +03:00
parent 9035a8b17e
commit f9c23402e1

View File

@@ -110,7 +110,7 @@ void SdccParser::stdError(const QString &line)
return; return;
} }
re.setPattern("^(.+\\.\\S+):(\\d+): (Error|syntax error): (.+)$"); re.setPattern("^(.+\\.\\S+):(\\d+): (Error|error|syntax error): (.+)$");
match = re.match(lne); match = re.match(lne);
if (match.hasMatch()) { if (match.hasMatch()) {
enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, enum CaptureIndex { FilePathIndex = 1, LineNumberIndex,
@@ -250,6 +250,18 @@ void BareMetalPlugin::testSdccOutputParsers_data()
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("Compiler simple single line error")
<< QString::fromLatin1("c:\\foo\\main.c:63: error: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: error: Some error\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("Some error"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
63,
categoryCompile))
<< QString();
QTest::newRow("Compiler single line error") QTest::newRow("Compiler single line error")
<< QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error") << QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error")
<< OutputParserTester::STDERR << OutputParserTester::STDERR