Classify unrecognized command line options as an error

Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2024-10-11 21:20:36 +02:00 committed by Torbjorn-Svensson
parent 4d0eaacf4a
commit 27b8da4ecd
3 changed files with 11 additions and 0 deletions

View file

@ -232,4 +232,13 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
"unused parameter 'bitrate' [-Wunused-parameter]" },
new String[] { GCC_ERROR_PARSER_ID });
}
@Test
public void testGccErrorMessages_UnrecognizedCommandLineOption() throws IOException {
runParserTest(new String[] { "arm-none-eabi-gcc: error: unrecognized command-line option '--foobar'" }, 1, // errors
0, //warnings
0, //infos
null, new String[] { "unrecognized command-line option '--foobar'" },
new String[] { GCC_ERROR_PARSER_ID });
}
}

View file

@ -67,6 +67,7 @@ CDTGNUCErrorParser.regex.ParseErrorBefore=(.*?):(\\d+):(\\d+:)? (parse error bef
CDTGNUCErrorParser.regex.ErrorUndeclared=(.*?):(\\d+):(\\d+:)? [Ee]rror: ([`'"](.*)['"] undeclared .*)
CDTGNUCErrorParser.regex.ErrorConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ee]rror: (conflicting types for .*[`'"](.*)['"].*)
CDTGNUCErrorParser.regex.GenericError=(.*?):(\\d+):(\\d+:)?\\s*(([Ee]rror)|(ERROR)): (.*)
CDTGNUCErrorParser.regex.InvocationError=(.*?): (([Ee]rror)|(ERROR)): (.*)
CDTGNUCErrorParser.regex.DefinedButNotUsed=(.*?):(\\d+):(\\d+:)? [Ww]arning: ([`'"](.*)['"] defined but not used.*)
CDTGNUCErrorParser.regex.WarningConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ww]arning: (conflicting types for .*[`'"](.*)['"].*)
CDTGNUCErrorParser.regex.GenericWarning=(.*?):(\\d+):(\\d+:)?\\s*(([Ww]arning)|(WARNING)): (.*)

View file

@ -241,6 +241,7 @@
regex="%CDTGNUCErrorParser.regex.GenericError"
severity="Error"
variable-expr="$3"/>
<pattern description-expr="$5" eat-processed-line="true" file-expr="" line-expr="" regex="%CDTGNUCErrorParser.regex.InvocationError" severity="Error" variable-expr=""/>
<pattern description-expr="$7" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericWarning" severity="Warning"/>
<pattern description-expr="$10" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericInfo" severity="Info"/>
<pattern description-expr="$4" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.OtherError" severity="Error"/>