代码覆盖率报告与导出的XML报告不匹配 [英] Code Coverage Report Does Not Match Exported XML Report

查看:130
本文介绍了代码覆盖率报告与导出的XML报告不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有。


我有一个由构建生成的.coverage文件。 我可以在Visual Studio中打开该文件,并查看代码覆盖率结果。 如果我使用CodeCoverage工具将.coverage文件导出到xml文件中,我看到两个报告中的差异,当
它们应该相同时。


ex。 CodeCoverage.exe分析/输出:D:\ MyTestResults.xml D:\ MyTest.coverage


在我看来,.coverage文件中的值应该与在xml输出中。


我试过谷歌搜索但找不到答案。 


此StackOverflow链接还描述了同样的问题:  visual-studio-code-coverage-does-not-match-when-exported-to-xml


有人可以为我解答这个问题吗?




-7

解决方案

嗨朋友,< o:p>< / o:p>


欢迎来到MSDN论坛。< o:p>< / o:p>


我不能在我身边重现这个问题。 xml中的结果与我机器中VS IDE中的结果相同。< o:p>< / o:p>


环境:windows10,VS2017,使用C#单元项目作为测试对象
在调试模式下创建代码覆盖率文件< o:p>< / o:p>


调试或发布模式下的代码分析结果可能不同。所以我想知道你使用哪种模式,调试或发布?请确保使用调试模式来分析
代码,并在调试模式下从coverage文件中获取xml。然后,如果您使用发布模式,请确保从基于发布的代码覆盖文件中获取xml。 < o:p>< / o:p>


如果你可以分享更多细节(有关机器,版本的细节,是否添加对某些指定dll的引用),它可能会好得多,它可以帮助我们
找出问题的原因。< o:p>< / o:p>


另外,如果方便的话,请您分享一个简单的样本(一个驱动器的项目或代码覆盖文件)同样的问题,因此我们可以直接为你检查。< o:p>< / o:p>


期待收到您的回复。< o:p>< / o:p>


最好的问候。< o:p>< ; / O:p为H.


Hey all.

I have a .coverage file generated by a build.  I can open the file in Visual Studio and see the code coverage results.  If I use the CodeCoverage tool to export the .coverage file into an xml file, I am seeing differences in the two reports when they should be the same.

ex. CodeCoverage.exe analyze /output:D:\MyTestResults.xml D:\MyTest.coverage

In my opinion, the values in the .coverage file should be the same as the ones in the xml output.

I have tried googling this but could not find an answer. 

This StackOverflow link also describes the same issue: visual-studio-code-coverage-does-not-match-when-exported-to-xml

Can anyone answer this for me?


-7

解决方案

Hi friend ,<o:p></o:p>

Welcome to MSDN forum.<o:p></o:p>

I can’t reproduce this issue at my side. The result in xml is the same as that in VS IDE in my machine.<o:p></o:p>

Environment: windows10 , VS2017, using a C# unit project as a test object, create the code coverage file in debug mode<o:p></o:p>

The code analyze results in debug or release mode can be different. So I wonder which mode you use, debug or release? Please make sure you use debug mode to analyze code, and get the xml from the coverage file in debug mode. Then if you use release mode, make sure you get the xml from release-based code coverage file. <o:p></o:p>

And it could be much better if you can share more details (details about machine, vs version, whether add references to some specified dlls),  it helps us locate the cause of the issue.<o:p></o:p>

Also, if convenient could you please share a simple sample(a project or a code coverage file by one drive) with same issue, thus we can check it directly for you.<o:p></o:p>

Looking forward to hearing from you.<o:p></o:p>

Best regards.<o:p></o:p>


这篇关于代码覆盖率报告与导出的XML报告不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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