Exporting coverage data to Cobertura XML #741
Replies: 3 comments 2 replies
-
Hi @nickg, Wow, Cobertura export looks cool :) I agree that UCIS XML is usefull. As for the The only use-case where I can think of exporting UCIS/XML from single test run, is if there was a way how to merge the coverage from various UCIS/XML files in some external tool. I am not sure how to do this with I am not sure about splitting the WBU following format:
Similar to this topic, (but reverse), is tracking in which test a coverage item was covered. When someone merges coverage from e.g. 20 different tests, it would be handy somehow to remember the source covdb/run-folder, so that user can get something like: |
Beta Was this translation helpful? Give feedback.
-
On #507 I suggested adding a
For 2 and 3 there needs to be a way to merge results, but that can be done by listing multiple top-levels e.g. |
Beta Was this translation helpful? Give feedback.
-
I agree that |
Beta Was this translation helpful? Give feedback.
-
@qarlosalberto asked on LinkedIn about integrating the coverage output from NVC into TerosHDL. At the moment it's not possible to export coverage data from NVC's proprietary format into other tools so I added a command to generate Cobertura XML. This is quite a popular format which allows import into GitLab and other CI systems that support code coverage. I've tested with pycobertura but it should work with any other tool. However the format doesn't support hardware-specific features like toggle coverage or separating coverage by design hierarchy so we probably want to add UCIS XML at some point too. That would allow us to directly plug-in to pyucis, pyEDAA.UCIS, etc and even import into RiveraPro and other tools that support the UCIS interchange format.
You can export the data with
nvc -c --export=out.xml path/to/file.covdb
but I feel thenvc -c
command is a bit difficult and non-intuitive to use at the moment so I experimented with also adding a standalone commandnvc --cover-export --format=cobertura -o out.xml toplevel
wheretoplevel
is the top-level unit name as with-e
,-r
, etc. This way you don't have to know the path to the.covdb
file (which is sort-of private anyway as it's within the library directory) and the options are easier to understand as the--cover-export
options are grouped separately rather than being mixed in with the other-c
options. It's also possible to chain this command with others e.g.nvc -e --cover toplevel -r --cover-export --format=cobertura -o out.xml
. I'm considering replacing-c
with--cover-report
which would also generate the.covdb
file name automatically from the top-level name. E.g.nvc --cover-report toplevel --html=html/ --exclude=...
. @Blebowski?Beta Was this translation helpful? Give feedback.
All reactions