danielpalme/OpenCoverToCoberturaConverter — pull request #4 by flankamon (2014-10-02 04:42:19+00:00)
Title: Branch Line Additions

Hi,
After contacting the developer of OpenCover about adding a corresponding line number to the BranchPoint element, I updated the Converter.cs file to add the code coverage of each branch to the method Line and Class Line item. I tested this against the OpenConver xml. Here is a sample of the Cobertura xml with the branch coverage.

In Method Item
...

Class Item
...

Also, if a BranchPoint does not correspond to a Line, it adds a Line Item with a fake line number (-1). This is only good for showing correct coverage.

We've tested this against the new OpenCover release and the Cobertura report tool (https://github.com/cobertura/cobertura).

OpenCover update: (from developer)
https://github.com/sawilde/opencover/blob/master/ReleaseNotes.tmp
molnagab did work on just that and as I understand it, it us also supported by ReportGenerator. https://github.com/OpenCover/opencover/pull/208

How I run it:
OpenCoverToCoberturaConverter.exe -input:opencover.xml -output:outputCobertura.xml -sources:%WORKSPACE%

Thanks. I hope this is of some use.

--Paul