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

addons:misra: export result to xml junit #6452

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RomainPelletant
Copy link

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

Romain Pelletant added 2 commits May 27, 2024 16:03
Add junit export support based on junit-xml
Each error in a testcase

Signed-off-by: Romain Pelletant <[email protected]>
Add junit-xml as requirement

Signed-off-by: Romain Pelletant <[email protected]>
@danmar
Copy link
Owner

danmar commented Jun 3, 2024

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
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
Copy link
Owner

danmar commented Jun 9, 2024

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

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
Copy link
Owner

danmar commented Sep 28, 2024

@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