Is it possible to export report as Cobertura xml. So that i can use the report in VSTS/ TFS
I know that i can use a custom report. but i just want to know is it already implemented?
No that is not supported.
Pleased have a look at https://github.com/danielpalme/OpenCoverToCoberturaConverter
Yes. I had a look on that. but I need to combine Cobertura and dotcover/opencover report using report generator which is currently possible. Then generated report i need to submit. so it seems i need to implement custom report or i have to build custom version of OpenCoverToCoberturaConverter
any other suggestion?
Both approaches will be quite hard to implement.
_OpenCoverToCoberturaConverter_ neither supports _DotCover_ nor does it support merging several input files.
_ReportGenerator_ does not provide enough information to generate a full Cobertura file.
Here is a sample Cobertura snippet:
<package name="test.sub" line-rate="0.0" branch-rate="1.0" complexity="1.0">
<classes>
<class name="test.sub.Sub" filename="test/sub/Sub.java" line-rate="0.0" branch-rate="1.0" complexity="1.0">
<methods>
<method name="<init>" signature="()V" line-rate="0.0" branch-rate="1.0" complexity="0">
<lines>
<line number="3" hits="0" branch="false"/>
</lines>
</method>
<method name="SampleFunction" signature="()V" line-rate="0.0" branch-rate="1.0" complexity="0">
<lines>
<line number="5" hits="0" branch="false"/>
<line number="9" hits="0" branch="false"/>
</lines>
</method>
</methods>
<lines>
<line number="3" hits="0" branch="false"/>
<line number="5" hits="0" branch="false"/>
<line number="9" hits="0" branch="false"/>
</lines>
</class>
</classes>
</package>
ReportGenerator does not contain the information to create the <method> elements.
I was managed to overcome this using custom report
Can you share your code? Then I can add it to ReportGenerator, so everybody can use it.
The documentation states that Cobertura is one of the output formats. The usage page also includes Cobertura and will generate the following snippet "-reporttypes:Cobertura". When running with this as a report type I receive the error: "Unknown report type 'cobertura'."
@teeohdeedee
You have to use the latest pre release:
https://www.nuget.org/packages/ReportGenerator/4.0.0-rc4
Thanks! ..... and thanks for the very quick response!!