PartCover 控制台生成空输出 xml
我正在使用 partcover 为一堆由 mstest 驱动的单元测试生成代码覆盖率。
我使用命令行:
PartCover.exe --target "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/testcontainer:c:\CrusieControlProjects\AcademyPro\AcademyTests\bin\Release\AcademyTests.dll" --include [AcademyPro*]*
这会运行,所有测试都通过,但我最终会得到输出:
Results file: C:\Program Files\Gubka Bob\PartCover .NET 2.3\TestResults\Administrator_PSLV22 2009-03-31 17_54_18.trx
Run Configuration: Default Run Configuration
Target PageFaultCount: 10565
Target PagefileUsage: 27631616
Target PeakPagefileUsage: 31297536
Target PeakWorkingSetSize: 31498240
Target QuotaNonPagedPoolUsage: 8180
Target QuotaPagedPoolUsage: 217124
Target QuotaPeakNonPagedPoolUsage: 13012
Target QuotaPeakPagedPoolUsage: 255524
Target WorkingSetSize: 30310400
request target shutdown
<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />
当我使用 --output 命令运行时,xml 文件最终会显示
<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />
为什么会发生这种情况?
I'm using partcover to produce codecoverage for a bunch of mstest powered unit tests.
I use the command line:
PartCover.exe --target "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/testcontainer:c:\CrusieControlProjects\AcademyPro\AcademyTests\bin\Release\AcademyTests.dll" --include [AcademyPro*]*
This runs, all tests pass, but I end up with the output:
Results file: C:\Program Files\Gubka Bob\PartCover .NET 2.3\TestResults\Administrator_PSLV22 2009-03-31 17_54_18.trx
Run Configuration: Default Run Configuration
Target PageFaultCount: 10565
Target PagefileUsage: 27631616
Target PeakPagefileUsage: 31297536
Target PeakWorkingSetSize: 31498240
Target QuotaNonPagedPoolUsage: 8180
Target QuotaPagedPoolUsage: 217124
Target QuotaPeakNonPagedPoolUsage: 13012
Target QuotaPeakPagedPoolUsage: 255524
Target WorkingSetSize: 30310400
request target shutdown
<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />
When I run with the --output command the xml file ends up with just
<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />
Why might this be happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了解决这个问题,我最终降级了。
我使用的是 2.3 版本(这是一个开发版本),后来切换到了 2.2 版本。
现在测试运行良好,我得到了合理的覆盖率数据。
也许这会对某人有所帮助。
To fix this I ended up downgrading.
I was using version 2.3 (which is a dev build) and switched to version 2.2.
Now the tests run fine and I get sensible coverage data.
Maybe that will help someone.
我在 x64 上使用 NUnit 时遇到了类似的问题。 问题是我使用的是 nunit-console.exe (AnyCPU)。 切换到 nunit-console-x86.exe(明确 32 位)解决了问题。
我无权访问包含 MSTest 的环境,但如果您引用的可执行文件是 AnyCPU,您可能会在系统上查找它的显式 32 位版本。 最坏的情况是,您可以使用 CorFlags 创建一个。
I was having a similar problem with NUnit on x64. The problem was that I was using nunit-console.exe (AnyCPU). Switching to nunit-console-x86.exe (explicitly 32-bit) solved the problem.
I don't have access to an environment with MSTest, but if the executable you're referencing is AnyCPU, you might look for an explicitly 32-bit version of it on your system. Worst case, you could create one using CorFlags.