cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

addons:misra: export result to xml junit

Open RomainPelletant opened this issue 1 year ago • 3 comments

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

RomainPelletant avatar May 27 '24 14:05 RomainPelletant

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.

danmar avatar Jun 03 '24 17:06 danmar

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?

RomainPelletant avatar Jun 03 '24 19:06 RomainPelletant

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.

danmar avatar Jun 09 '24 14:06 danmar

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

aygupt1822 avatar Sep 13 '24 09:09 aygupt1822

@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.

danmar avatar Sep 28 '24 10:09 danmar