subs
subs

Reputation: 2249

Visual studio unit test Code coverage without the code

I want to check code coverage of my unit tests. For some reason I am not able to install visual studio 2010 Ultimate in my Dev box.

I also have a test machine where I can install VS ultimate 2010. The product is also installed in this machine. Is it possible to check code coverage in VS ultimate without checking out code from TFS to the Test machine? Is it possible to use .pdb files( copy from my Dev box to Test box) to check code coverage? Is there any other method that I can check the code coverage without checking out the whole code?

I don't want to install VS ultimate in Test Machine without knowing if this is possible at all.

Upvotes: 0

Views: 676

Answers (1)

vendettamit
vendettamit

Reputation: 14687

The converage/profiling tools in the Visual studio works via instrumentation of assembly.

The process of profiling/coverage re-builds the assemblies do some instrumentation and then start your application. Now the more you explore the application, more the code gets executed. This all can be seen in coverage report which gets generated after you stop the profiling.

You can also use the command line utility for instrumentation for coverage. You might need to setup different arguments if your application is web application:

vsinstr -coverage helloclass.exe
vsperfcmd /start:coverage /output:run.coverage
helloclass
vsperfcmd /shutdown

You can simply copy/paste the repository to the Test machine and run code coverage. This would save some time and would be convenient instead of creating a batch file and using command lines etc.

Upvotes: 1

Related Questions