VS2013中的代码覆盖率显示测试的覆盖率,而不是实际代码的覆盖率 [英] Code coverage in VS2013 show coverage of Test and not actual code

查看:603
本文介绍了VS2013中的代码覆盖率显示测试的覆盖率,而不是实际代码的覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注有关在 VS 2013 中进行代码覆盖的文章 http://msdn.microsoft.com/en-us/library/dd537628.aspx .它显示了Test的覆盖范围,而不是实际的代码.

I am following article for code coverage in VS 2013 http://msdn.microsoft.com/en-us/library/dd537628.aspx. It shows coverage of Test and not actual code.

我从 Test Explorer 中选择了单元测试,然后单击Analyze Code Coverage -> Selected Test.底部打开代码覆盖率"窗口,其中显示了单元测试的dll,并且未显示其覆盖率和具有代码​​覆盖率的实际dll.

I have selected unit test from Test explorer and click on Analyze Code Coverage -> Selected Test. Code coverage window is opened up at the bottom and It shows dll of unit test and its coverage and actual dll with code coverage is not shown.

我还浏览了文章 http://msdn.microsoft.com/library/jj159523. aspx .将pdbs和dll复制到同一位置.在代码覆盖率窗口中,消息为

Also, I looked into article http://msdn.microsoft.com/library/jj159523.aspx. Copied pdbs and dll into same location. In the code coverage window message was

生成的空结果:未检测到二进制文件.确保测试已经运行,所需的二进制文件已加载,具有匹配的符号文件,并且没有被自定义设置排除.有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=253731"

对此有任何想法吗?

推荐答案

我已经尝试了链接中给出的步骤.

I have tried steps given in the link.

如果使用的是VS 2013,请稍作更改.

Slight change if you are using VS 2013.

a)环境变量VS120COMNTOOLS设置为\ common7 \ tools

a) Environment variable VS120COMNTOOLS is set to \common7\tools

b)Regkey HKLM \ SOFTWARE \ Microsoft \ VisualStudio \ 12.0 \ InstallDir设置为您的\ Common7 \ IDE \

b) Regkey HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\InstallDir is set to your \Common7\IDE\

c)"\ Team Tools \ Dynamic代码覆盖率"中存在covrun32.dll和covrun64.dll

c) covrun32.dll and covrun64.dll exist in "\Team Tools\Dynamic Code Coverage"

已删除VS110COMNTOOLS环境变量.这些更改对我有用.

Removed VS110COMNTOOLS environment variable. These changes worked for me.

这篇关于VS2013中的代码覆盖率显示测试的覆盖率,而不是实际代码的覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆