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
...<line number="12" hits="3" branch="false" />
   <line number="13" hits="3" branch="true" condition-coverage="50% (1/2)" />
Class Item
...<line number="12" hits="3" branch="false" />
   <line number="13" hits="3" branch="true" condition-coverage="50% (1/2)" />

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