Cobertura output

Jan 18 at 10: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

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.
Jan 23 at 10:42 AM

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,

Jan 24 at 5:11 AM
Thank you very much for your answer.
Feb 26 at 11:35 AM

OpenCppCoverage 0.9.6 generates valid Cobertura files against

Let me know if you have any issues.

Mar 7 at 11:23 AM

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">
Mar 20 at 12:30 PM

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