diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-10-13 18:53:09 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-10-14 09:22:04 +0000 |
commit | f9c23402e180f6ebeecea161e3e307760842f5f9 (patch) | |
tree | b65054708a4e657c860cd0784b592fcd2fe8fae1 | |
parent | 9035a8b17e8c33ed8bee550d139111a63442416c (diff) |
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>
-rw-r--r-- | src/plugins/baremetal/sdccparser.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index c7c436422a..57a8606d5c 100644 --- a/src/plugins/baremetal/sdccparser.cpp +++ b/src/plugins/baremetal/sdccparser.cpp @@ -110,7 +110,7 @@ void SdccParser::stdError(const QString &line) return; } - re.setPattern("^(.+\\.\\S+):(\\d+): (Error|syntax error): (.+)$"); + re.setPattern("^(.+\\.\\S+):(\\d+): (Error|error|syntax error): (.+)$"); match = re.match(lne); if (match.hasMatch()) { enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, @@ -250,6 +250,18 @@ void BareMetalPlugin::testSdccOutputParsers_data() categoryCompile)) << 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") << QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error") << OutputParserTester::STDERR |