我们通过命令行工具以及 CruiseControl.Net 单元测试生成 PartCover 报告。这会生成一个 xml 文件,该文件可以在 Cruisecontrol 仪表板上很好地显示结果。包含的 xslt 转换仅显示单个类中的覆盖百分比。我们想确切地知道哪些线路没有被覆盖。问题是,当我们在 PartCover 浏览器中打开报告并双击方法时,它不会显示我们的 cs 文件。我知道 PartCover 浏览器能够向您显示文件,原因如下。
以下是 PartCover 浏览器的屏幕截图,其中显示了代码行: http:// kjkpub.s3.amazonaws.com/blog/img/partcover-browse.png。
该信息看起来应该可供浏览器使用,因为报告包含以下内容:
和这个:
我想要做的就是查看测试用例中未涵盖哪些代码行,而不必弄清楚上面的 xml 试图告诉我什么。
提前感谢任何回复的人。
We're generating PartCover reports via the command line tool along with our CruiseControl.Net unit tests. This generates an xml file that displays the results nicely on the cruisecontrol dashboard. The xslt transforms that are included only show you the percentage of coverage in an individual class. We want to know exactly what lines are not being covered. The problem ist when we open the report in the PartCover browser and double click a method it doesn't show us our cs files. I know the PartCover browser is capable of showing you the files because of the following.
Here's a screenshot of PartCover browser with the lines of code showing: http://kjkpub.s3.amazonaws.com/blog/img/partcover-browse.png.
The information looks like it should be available to the browser because the report contains this:
<Method name="get_DeviceType" sig="Cathexis.IDBlue.DeviceType ()" bodysize="19" flags="0" iflags="0">
<pt visit="2" pos="0" len="1" fid="82" sl="35" sc="13" el="35" ec="14" />
<pt visit="2" pos="1" len="4" fid="82" sl="36" sc="17" el="36" ec="39" />
<pt visit="2" pos="5" len="2" fid="82" sl="37" sc="13" el="37" ec="14" />
</Method>
and this:
<File id="66" url="D:\sandbox\idblue\idblue\trunk\software\code\driver\dotnet\Common\AsyncEventQueue.cs" />
All I want to be able to do is view what lines of code are not being covered in my test cases without having to figure out what the xml above is trying to tell me.
Thanks to anyone in advance who replies.
发布评论
评论(1)
我弄清楚了为什么 cs 文件没有显示。 xml 文件中的路径不正确,因为我们的测试项目是在与一个partcover 不同的机器上构建的。 (partcover 必须从 pdb 文件生成 .cs 文件路径吗?)一旦我搜索并替换了文件,将我们的 subversion 位置的基本目录切换到另一台机器上的目录,一切都很好。
I figured out why the cs files were not displaying. The paths were incorrect in the xml file because our test project was being built on a different machine than the one partcover was on. (partcover must generate the .cs file paths from pdb files maybe?) Once I search and replaced the file switching the base directory of our subversion location to the one on the other machine all was well.