Jenkins : MSTest Coverage Reports

MSTest Coverage

MSTests can compute Code Coverage Statistics, but its only output is in binary form. To be able to generate reports, this binary must be transformed to XML. Thankfully, Microsoft provides an interface to do just so, and someone created a MSBuild task for this :

This MSBuild tasks creates a xml report that can now be exploited to create a nice Coverage Report.

In order to avoid writing a new hudson plugin from scratch, a XSL Transformation was devised that transformed MSTest's Coverage report into a Emma Coverage report, so the Emma hudson plug-in can display the reports.

The said XSL in attached to this page.

You have to run the XSLT yourself for now (an MSBuild Exec task can do it, provided you have msxsl at hand) :

<Exec Command="msxsl.exe $(SolutionDir)\$(RunConfig)\In\$(ComputerName)\data.xml $(DevToolsDir)\MSTestCoverageToEmma.xsl -o $(SolutionDir)\coverage.xml" />