0
votes

I am using the TFS 2013\VS 2013 professional editions for continuous build. Am looking to use an open source tool like OpenCover for code coverage. I have no prior experience in code coverage tools. I installed the OpenCover UI from Nuget but not sure how to include Codecoverage in integrated build in TFS. Getting "No Code Coverage Results" when the build runs.

I enabled code coverage under Automated tests node in build definition.

Any suggestion on how to implement code coverage in TFS\VS 2013 Profession edition would be greatly appreciated.

1

1 Answers

0
votes

If you mean Enabled Code Coverage in the build definition just like below screeshot.

enter image description here

This is VS build-in code coverage, according to the Compare VS offerings site, only Visual Studio Enterprise has Code Coverage feature, so if you use TFS for your CI build and want to use the built-in code coverage feature, installing VS Enterprise on your build agent machine is required.


If you want to integrate OpenCover with TFS XAML build, you need to customize your build process template, add a custom activity in the build definition to trigger the opencover command for generating the report.

There is the cmd contents:

@REM @echo suppresses command line. ^ is line continuation character
@ECHO Executing OpenCover...
OpenCover.Console.exe -register:user ^
-target:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" ^
-targetargs:"/testcontainer:%~dp0test.dll /usestderr /resultsfile:%~dp0MSTestsResults.trx" ^
-output:%~dp0opencovertests.xml

More details please refer Naim Raja Díaz's answer in this similar question:Integration of OpenCover with TFS