问题
I was using Visual Studio 2010 ultimate edition without any service pack to do code coverage test for my native c++ project but Code Coverage Coloring seems not working for me. Are my steps correct?
1) I used the two command line tools vsinstr.exe and vsperfmon.exe to perform instrumentation and code coverage collection on a separate machine without my project directory/source code. I just copied my compiled native .exe file to there. The reason I need to use a separate machine is that my VS2010 is installed in a virtual machine (virtual box) and code coverage seems not working under a virtual machine.
2) I instrumented the exe/run the test (as decribed by the 2 links below) and ended up having a .coverage file, and 2 instrumented .exe/.pdb files. Then I copied these 3 files back to my full VS2010 ultimate machine (under virtual box)with my project directory and source codes.
http://blogs.msdn.com/b/phuene/archive/2007/05/14/code-coverage-collection.aspx http://blogs.msdn.com/b/phuene/archive/2007/05/03/code-coverage-instrumentation.aspx
3) I opened the .coverage file and the result can be read in the Code Coverage Results windows and the Go To Source Code feature was working except that the C++ source code located by it was not colored (I have selected the Show Code Coverage Coloring button).
How do I enable code coverage coloring for native C++ project?
回答1:
Probably a bug in VS2010 that is fixed after installing SP1
来源:https://stackoverflow.com/questions/15134644/visual-studio-2010-native-c-code-coverage-coloring-not-working