From f9c23402e180f6ebeecea161e3e307760842f5f9 Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Sun, 13 Oct 2019 18:53:09 +0300 Subject: [PATCH] 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 --- src/plugins/baremetal/sdccparser.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index c7c436422a2..57a8606d5c4 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