简体   繁体   English

Visual Studio 2010本机C ++代码覆盖率着色不起作用

[英]Visual Studio 2010 Native C++ Code Coverage Coloring Not Working

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. 我使用没有任何Service Pack的Visual Studio 2010终极版来为本机c ++项目进行代码覆盖率测试,但是“代码覆盖率着色”似乎不适用于我。 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. 1)我使用了两个命令行工具vsinstr.exe和vsperfmon.exe在没有我的项目目录/源代码的单独机器上执行检测和代码覆盖率收集。 I just copied my compiled native .exe file to there. 我只是将编译的本机.exe文件复制到了那里。 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. 我需要使用单独的计算机的原因是,我的VS2010已安装在虚拟机(虚拟机)中,并且代码覆盖范围似乎在虚拟机下无法正常工作。

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. 2)我检测了exe /运行测试(如下面的2个链接所述),最终得到了一个.coverage文件和2个检测到的.exe / .pdb文件。 Then I copied these 3 files back to my full VS2010 ultimate machine (under virtual box)with my project directory and source codes. 然后,将这3个文件及其项目目录和源代码复制回我的完整VS2010 Ultimate计算机(在虚拟框中)。

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 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). 3)我打开了.coverage文件,可以在“代码覆盖率结果”窗口中读取结果,并且“转到源代码”功能正常工作,只是其所在的C ++源代码未着色(我选择了“显示代码覆盖率着色”按钮)。

How do I enable code coverage coloring for native C++ project? 如何为本机C ++项目启用代码覆盖颜色?

可能是VS2010中的一个错误,该错误在安装SP1后已修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM