Visual Studio code coverage configuration and usage step by step
From QT Wikipedia
I will try to explain how to know code coverage in application build with visual studio.
First we will need tweak some Linker options. Add /Profile key.
Contents |
Profile settings screen shot
After building we need open Visual Studio Command Prompt and go to directory where is located vsintr.exe tool
in my case tool was located in following location
c:\Program Files\Microsoft Visual Studio 8\Team Tools\Performance Tools\
Covering application
Then you have build'ed your application copy executable (<compiled filename>.exe) and<compiled filename>.pdb to the same directory. It's unnecessary if you will use this command specifying full path to vsintr.exe executable.
After this step execute following command:
vsinstr.exe -coverage <compiled filename>.exe
Starting coverage logger
Then start logger witch logs all actions. Logger is started with this command
vsperfcmd.exe -start:coverage -output:testcoverate.coverage
Starting our executable program
At this step you can turn on your previously covered program. I mean program to witch "vsinstr.exe -coverage <compiled filename>.exe" command was executed. After that you should see in same directory file called testcoverate.coverage. After program execution you can stop logger with this command
VSPerfCmd.exe -shutdown
Viewing results
After all this procces you can open generated file <testcoverate.coverage> in visual studio.
Conclusions
So coverage analysis is quiet simple then you now what to do :)
