Visual Studio code coverage reporting

Hi All,

I am not using a standard tool for my unit tests - I am using Cpputest.
So I cannot use any of the built-in tool of TeamCity to get the coverage displays in team city like Ant, Maven or MSBuild
I can get the report of the tests using XML report processing as an ANT Junit. But I cannot get the code coverage report.

I am using codecoverage.exe from Visual Studio 2012.

I get a XML file by folowing these steps :
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Dynamic Code Coverage Tools

To get the coverage file :

<?xml version="1.0" encoding="UTF-8" ?>
    <module name="zynqlibtests.exe" path="zynqlibtests.exe" id="548F767AFDD35F46872B3C0DA47A65C702000000" block_coverage="39.92" line_coverage="45.59" blocks_covered="2933" blocks_not_covered="4414" lines_covered="2009" lines_partially_covered="79" lines_not_covered="2319">
        <function id="4096" name="testBody" type_name="TEST_CADCDriver_GetInternalTemperature25C_Test" block_coverage="100.00" line_coverage="100.00" blocks_covered="3" blocks_not_covered="0" lines_covered="4" lines_partially_covered="0" lines_not_covered="0">
            <range source_id="52" covered="yes" start_line="33" start_column="0" end_line="33" end_column="0" />

I wanted to know if I missed a plugin or built-in option that displays the result of a standard tool of Visual Studio in TeamCity ?

If not I guess, I guess I will create my first plugin for TeamCity... :p

Thanks for your help


Comment actions Permalink

Hi Dave,

Visual Studio code coverage reporting is not supported yet. As for now you can generate HTML report for the coverage, specify the report as artifact and make TeamCity display it as a report tab.
Please see the related doc section and vote for the related feature request

Comment actions Permalink

Thanks for your answer.

That is a bit disapointing, I hope they will add this feature in the futur, specialy that Visual studio does not generate an HTML report.

VS can only give you an XML file that is not taken in account by TC neither.

I have used ReportGenerator that generates an HTML report.

And then I have added a tab as suggested.


Please sign in to leave a comment.