CoverageDS.Join()将覆盖和未覆盖的块设置为0 [英] CoverageDS.Join() sets Blocks Covered and Uncovered to 0

查看:100
本文介绍了CoverageDS.Join()将覆盖和未覆盖的块设置为0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加入2个覆盖率文件时,所有阻止" data设置为0.我可以加入2个相同的文件,但仍然会丢失块数据,但是所覆盖的行仍然是正确的.我做错什么了吗?  

When I join 2 coverage files, all the "Block" data is set to 0.  I can join 2 of the same files and still lose the block data, but the lines covered is still correct.  Am i doing something wrong?  

这是一个简单的示例,其中FileA.xml和FileB.xml非常好,而AJoinedA.xml和AJoinedB.xml是正确的,除了覆盖和发现的块为0.

This is a simple example where FileA.xml and FileB.xml are perfectly fine, while AJoinedA.xml and AJoinedB.xml are correct except blocks covered and uncovered are 0.

CoverageDSPriv CCFileA =  CoverageInfo.CreateFromFile("fileA.coverage").BuildDataSet());
CoverageDSPriv CCFileB = CoverageInfo.CreateFromFile("fileB.coverage").BuildDataSet());
                  
CCFileA.WriteXml("FileA.xml")
CCFileA.WriteXml("FileB.xml")

CoverageDSPriv Combined = CoverageDS.Join(CCFileA, CCFileB);
CoverageDSPriv selfJoined = CoverageDS.Join(CCFileA, CCFileA);

Combined.WriteXml("AJoinedB.xml");
selfJoined.WriteXml("AJoinedA,xml");

MSDN网站还显示该类及其成员保留供内部使用,并不打算在您的代码中使用."及其所有代码分析类文档.  如果vstest或profiler给了我一个选择 另存为XML,则无需执行此操作.

Also the MSDN website shows "This class and its members are reserved for internal use and are not intended to be used in your code."  with all of its code analysis class documentation.  If vstest or profiler gave me an option to save as XML I wouldn't need to do this.

推荐答案

您好,Zev ,

Hi Zev ,

在将覆盖率文件转换为XML文件之前,代码覆盖率通常是否正常?看来您正在使用类似的代码覆盖率API ,如果这样的话,恐怕您会检查是否成功将coverage文件转换为XML文件.实际上,我们可以在代码覆盖率结果"窗口中以XML格式导出结果.

Whether the code coverage is normally before you convert the coverage file to XML file? It seems you are using the code coverage API like this, if so, I’m afraid that you would check whether you convert the coverage file to XML file successfully. Actually we could export the results in an XML format in the Code Coverage Results window.

参考:

> Microsoft代码覆盖率工具可以吗生成XML文件作为报告格式?

最好的问候


这篇关于CoverageDS.Join()将覆盖和未覆盖的块设置为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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