Reputation: 227
We have very complex web based product including solid number of web services etc. I'm trying to collect code coverage for all assemblies in our product using VS 2012 command line utility vstest.console.exe. It is pretty easy to collect code coverage for Unit Tests, however, there is no flag or switch that indicates that I can attach the process to IIS or collect info for web services (both client and server sides).
Any suggestions?
Upvotes: 7
Views: 16938
Reputation: 1991
From the toolbar menue at the top: TEST > Analyze Code Coverage > All Tests
The results show up in the Code Coverage Results window. TEST > Windows > Code Coverage Results
I have VS2012 Premium, not sure if this feature is in other tiers.
Upvotes: 5
Reputation: 151
Detailed instructions for collecting code coverage from IIS applications using Microsoft Test Manager(MTM) of Visual Studio 2012 Update 1 can be found in this blog: http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/28/code-coverage-in-microsoft-test-manager-in-visual-studio-update-1.aspx
Here is the summary:
Alternate solution:
Use CodeCoverage.exe to collect code coverage. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe. You don't need update 1 to be installed, but I recommend that you do so. Example:
CodeCoverage collect /IIS /session:WebSession /output:MyWebApp.coverage
Upvotes: 6