Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

how to convert codecov coverage results to Cobertura(Jenkins) file format

Rahul_K_2
Beginner
1,001 Views

I have done the code coverage Analysis of my CPP code using Intel codecov tool. Now i want to convert the result and want to see analysis using Cobertura file format. Please give the steps to do so.

Thank

0 Kudos
2 Replies
JenniferJ
Moderator
1,001 Views

The code coverage tool comes with Intel C++ Compiler does not output the result in Cobertura format. But you might be able to add a layer to convert the result.

Here is the steps on using the code coverage tool from Intel C++ compiler:

  1. compile the code with /Qprof-gen:srcpos /Qcov-gen /Qprof_dir:.\codecov
  2. run the app and it will generates a .dyn file under the .\codecov folder and you can run the app multiple times with different input data, and each time it will generate an unique .dyn file.
  3. run "profmerge" tool to merge the .dyn files into a summary file "pgopti.dpi" file
  4. finally run "codecov" tool:         >> codecov -prj test1 -dpi test1.dpi -txtbcvrg test1_bcvrg.txt

the last step above generates a text file. You can create a script to convert the txt file to other format.

More detailed info can be found from this Code Coverage link.

Jennifer

 

0 Kudos
Halvor_L_
Beginner
1,001 Views

I had the same issue, trying to convert XML from the codecov tool to Cobertura XML format. I ended up writing a Python script for converting to Cobertura format, see https://github.com/halvorlu/codecov-to-cobertura . Hope it can be useful to others as well.

Halvor

0 Kudos
Reply