Cobertura output

Jan 18 at 11:00 AM
Hello and thank you for an extremely practical tool!

We are using OpenCppCoverage to cover GTest executables in a Visual Studio Team Services environment which supports showing Cobertura reports integrated into the web interface. We would like to use the Cobertura xml file generated by OpenCppCoverage for this purpose, but VSTS only accepts files conforming to the schema at http://cobertura.sourceforge.net/xml/coverage-04.dtd.

Do you have any plans on updating the Cobertura export feature to this schema? Or perhaps you could give me some pointers on how to make this change myself.

Thank you again.
Coordinator
Jan 23 at 11:42 AM
Hello,

Thank you for your support.
I am working on the next release OpenCppCoverage 0.9.6 which I hope should be available in February.
If this improvement does not require too much work, I will try to include it in this release.

Perhaps, you can also parse the Cobertura output file and add missing fields, if you do not want to wait.

I hope this will help,

OpenCppCoverage
Jan 24 at 6:11 AM
Thank you very much for your answer.
Coordinator
Feb 26 at 12:35 PM
Hello,

OpenCppCoverage 0.9.6 generates valid Cobertura files against http://cobertura.sourceforge.net/xml/coverage-04.dtd.

Let me know if you have any issues.

OpenCppCoverage
Mar 7 at 12:23 PM
Hello,

I noticed that it does conform to the DTD now. However VSTS does not seem to accept it. I have made a script that "fixes" the output of the 0.9.5 version of OpenCppCoverage and that is compatible with VSTS.

The only differences I see between the script-modified version and this new version is the order of the attributes and the fact that your new version puts zeros for the new attributes while my script puts ones in them.

My "fixed" 0.9.5 version:
<coverage line-rate="0.40756464685449634" timestamp="1" version="1" branch-rate="1" branches-valid="1" branches-covered="1" complexity="1" lines-valid="2591" lines-covered="1056">
<package name="D:\a\1\s\cmake\Debug\SharedComponents.Tests.exe" line-rate="0.40756464685449634" complexity="1" branch-rate="1">
<class name="base64_rfc4648.hpp" filename="a\1\s\cppcodecb64decoderencoder\cppcodec\include\base64_rfc4648.hpp" line-rate="0.9285714285714286" complexity="1" branch-rate="1">

0.9.6 version:
<coverage line-rate="0.40772200772200773" branch-rate="0" complexity="0" branches-covered="0" branches-valid="0" timestamp="0" lines-covered="0" lines-valid="0" version="0">
<package name="D:\a\1\s\cmake\Debug\SharedComponents.Tests.exe" line-rate="0.40772200772200773" branch-rate="0" complexity="0">
<class name="base64_rfc4648.hpp" filename="a\1\s\cppcodecb64decoderencoder\cppcodec\include\base64_rfc4648.hpp" line-rate="0.9285714285714286" branch-rate="0" complexity="0">
Coordinator
Mar 20 at 1:30 PM
Hello,

Thank you for the feedback. I will try to do another fix in the next release.

OpenCppCoverage
Coordinator
Oct 25 at 12:00 PM
Hello,

As CodePlex is going read-only, I have added Fix cobertura export for Visual Studio Team Services in the roadmap.

OpenCppCoverage
Marked as answer by OpenCppCoverage on 10/25/2017 at 4:01 AM