Skip to content

addons:misra: export result to xml junit - #6452

Open
RomainPelletant wants to merge 3 commits into
cppcheck-opensource:mainfrom
RomainPelletant:addon/misra/export-result-to-xml-junit
Open

RomainPelletant wants to merge 3 commits into
cppcheck-opensource:mainfrom
RomainPelletant:addon/misra/export-result-to-xml-junit

Conversation

@RomainPelletant

Copy link
Copy Markdown

Add junit export support for MISRA addons directly.
Better implementation shall be done in cppcheckdata.py
Useful for CI

Add junit export support based on junit-xml
Each error in a testcase

Signed-off-by: Romain Pelletant <romain.pelletant@gmail.com>
Add junit-xml as requirement

Signed-off-by: Romain Pelletant <romain.pelletant@gmail.com>
@danmar

danmar commented Jun 3, 2024

Copy link
Copy Markdown
Collaborator

I don't understand this. Do I understand it correctly that if a violation is found then the junit xml will say that it is a testcase.
Imho you should look at if your ci can handle some compiler warnings in some way instead.

@RomainPelletant

Copy link
Copy Markdown
Author

Hello danmar, thank you for your message.
I would export misra violation output artifact as XML, like cppcheck-junit. Do you see a better alternative or method?

@danmar

danmar commented Jun 9, 2024

Copy link
Copy Markdown
Collaborator

you did not specify which ci you use. but there are already options:

  • you can save the output in xml format, by using cppcheck option --xml. Some CIs understand that format.
  • If you would run cppcheck with --template=gcc cppcheck outputs gcc warnings. There is broad support in CIs to handle compiler warnings.

In my humble opinion junit output does not seem applicable to cppcheck. the output does not say what test cases are executed.

@aygupt1822

Copy link
Copy Markdown

This is really helpful. Thank you @RomainPelletant for this. This makes working in pipeline very easy.
Again thank you again soo much for this !!!

@danmar

danmar commented Sep 28, 2024

Copy link
Copy Markdown
Collaborator

@aygupt1822 can you clarify? what kind of ci pipeline do you use?
what would the output look like. Does it show errors as failed test cases? So it indicates that no tests are executed if no violations are detected is that the goal?
if junit xml output was important then it would be better to implement it in cppcheck instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants