Skip to content

Commit

Permalink
Merge pull request #994 from Stargazer1998/ee_parser_new_warning_style
Browse files Browse the repository at this point in the history
[EA] Add support for categories separated by a brace
  • Loading branch information
uhafner authored Jan 9, 2024
2 parents ed0035e + 9b2b0e9 commit 38c2f61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class EmbeddedEngineerParser extends IssueParser {
"^\\[([^\\]]*)\\]\\s(?<severity>Warn)\\s-\\s(?<description>[^']*)'(?<module>[^']*)"
+ "'\\s(?<details>\\(?[^{]*)(?<serial>[^)]*\\})");
private static final Pattern WARNING_PATTERN = Pattern.compile(
"^\\[([^\\]]*)\\]\\s(?<severity>Error|Warn)\\s-\\s(?<category>.+):\\s(?<description>.+)");
"^\\[([^\\]]*)\\]\\s(?<severity>Error|Warn)\\s-\\s(?<category>[^:]*)" + "(:\\s|\\s\\()(?<description>.+)");

@Override
public Report parse(final ReaderFactory reader) throws ParsingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected EmbeddedEngineerParser createParser() {

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
softly.assertThat(report).hasSize(8);
softly.assertThat(report).hasSize(9);
softly.assertThat(report.get(0))
.hasModuleName("index_module")
.hasDescription("Complex type definition without referenced element found 'index_module' (uint8_t); {98CF1FE6-EC9C-43f1-e476-40EFCD63cA8D}")
Expand All @@ -45,6 +45,10 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasCategory("Error loading plugins from")
.hasDescription("Error loading plugins from C:\\file1\\idc\\sample_ext.x64.dll")
.hasSeverity(Severity.ERROR);
softly.assertThat(report.get(8))
.hasCategory("Out parameters")
.hasDescription("Out parameters 'Model_ptr_2345') are not supported. Please use 'return' or 'inout' parameters; {98CF1FE6-EC9C-43f1-e476-40EFCD63cA8D}")
.hasSeverity(Severity.WARNING_NORMAL);
}
}

3 changes: 2 additions & 1 deletion src/test/resources/edu/hm/hafner/analysis/parser/ea.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
[2023-03-10 12:04:25.0777] Warn - Code generation for element 'Module1' failed. Could not start code generation ; {ffeee99-9BD1-12345678}
[2023-03-10 12:04:25.0777] Warn - Code generation for element 'Module1' passed. Could not start code generation ; {ffeee99-9BD1-12345678}
[2023-03-10 12:04:25.1377] Warn - SampleValidation: no requirement linked to final node 'Module1_Node'.
[2023-03-10 12:04:22.1045] Error - Error loading plugins from: C:\file1\idc\sample_ext.x64.dll
[2023-03-10 12:04:22.1045] Error - Error loading plugins from: C:\file1\idc\sample_ext.x64.dll
[2024-01-05 10:52:27.3199] Warn - Out parameters ('Model_ptr_2345') are not supported. Please use 'return' or 'inout' parameters; {98CF1FE6-EC9C-43f1-e476-40EFCD63cA8D}

0 comments on commit 38c2f61

Please sign in to comment.