Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex tweak to restore support for older versions of IAR for ARM #84

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/edu/hm/hafner/analysis/parser/IarParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
*
* @author Claus Klein
* @author Ullrich Hafner
* @author Jon Ware
*/
public class IarParser extends RegexpLineParser {
private static final long serialVersionUID = 7695540852439013425L;

private static final String IAR_WARNING_PATTERN = ANT_TASK
+ "(?:(.*)\\((\\d+)\\) : )?(Error|Remark|Warning|Fatal [Ee]rror)\\[(\\w+)\\]: (.*)$";
+ "(?:\"?(.*?)\"?[\\(,](\\d+)\\)?\\s+:?\\s+)?(Error|Remark|Warning|Fatal [Ee]rror)\\[(\\w+)\\]: (.*)$";

/**
* Creates a new instance of {@link IarParser}.
Expand Down
10 changes: 9 additions & 1 deletion src/test/java/edu/hm/hafner/analysis/parser/IarParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Tests the class {@link IarParser}.
*
* @author Ullrich Hafner
* @author Jon Ware
*/
class IarParserTest extends AbstractParserTest {
IarParserTest() {
Expand All @@ -23,7 +24,7 @@ protected IarParser createParser() {

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
assertThat(report).hasSize(5).hasDuplicatesSize(1);
assertThat(report).hasSize(6).hasDuplicatesSize(1);

softly.assertThat(report.get(0))
.hasSeverity(Severity.WARNING_NORMAL)
Expand Down Expand Up @@ -60,5 +61,12 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasLineEnd(0)
.hasMessage("cannot open source file \"c:\\JenkinsJobs\\900ZH\\Workspace\\Lib\\Drivers\\_Obsolete\\Uart\\UartInterface.c\"")
.hasFileName("-");
softly.assertThat(report.get(5))
.hasSeverity(Severity.WARNING_NORMAL)
.hasCategory("Pe177")
.hasLineStart(861)
.hasLineEnd(861)
.hasMessage("function \"FlashErase\" was declared but never referenced")
.hasFileName("d:/jenkins/workspace/Nightly/src/flash/flashdrv.c");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
c:\JenkinsJobs\900ZH\Workspace\Product.900ZH\Src\System\AdditionalResources.h(17) : Fatal Error[Pe1696]: cannot open source file "System/ProcDef_LPC17xx.h"
C:\dev\bsc\daqtask.c(43) : Warning[Pe177]: variable "pgMsgEnv" was declared but never referenced
Fatal Error[Pe1696]: cannot open source file "c:\JenkinsJobs\900ZH\Workspace\Lib\Drivers\_Obsolete\Uart\UartInterface.c"
"d:\jenkins\workspace\Nightly\src\flash\flashdrv.c",861 Warning[Pe177]: function "FlashErase" was declared but never referenced