使用 MSTest 没有从 Partcover 获得结果
我正在尝试掌握 Partcover 以便与构建机器集成。
我使用以下命令在命令行中运行 Partcover:
PartCover.exe --settings settings.xml --output results.xml
我的 settings.xml 是使用 Partcover.Browser 自动生成的,如下所示:
<PartCoverSettings>
<Target>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe</Target>
<TargetWorkDir>S:\Work\Solution\</TargetWorkDir>
<TargetArgs>/testcontainer:"TestProject\bin\release\TestProject.dll"</TargetArgs>
<LogLevel>4</LogLevel>
<Rule>+[*]*</Rule>
</PartCoverSettings>
S:\Work\Solution
是解决方案的根目录。
当我在命令行中运行此命令时,测试全部运行并通过,但在命令行中显示测试设置:默认测试设置
后没有任何反应。没有创建 results.xml
文件,我看不到任何类型的代码覆盖率分析的证据。
我在设置文件中缺少一些简单的东西吗?或者这是一个更复杂的问题?
编辑:使用 Partcover 版本 2.2.36423
I am trying to get to grips with Partcover for possible integration with a build machine.
I am running Partcover in the command line with the following command:
PartCover.exe --settings settings.xml --output results.xml
My settings.xml was generated automatically using Partcover.Browser, and looks as follows:
<PartCoverSettings>
<Target>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe</Target>
<TargetWorkDir>S:\Work\Solution\</TargetWorkDir>
<TargetArgs>/testcontainer:"TestProject\bin\release\TestProject.dll"</TargetArgs>
<LogLevel>4</LogLevel>
<Rule>+[*]*</Rule>
</PartCoverSettings>
S:\Work\Solution
is the root directory of the solution.
When I run this in the command line the tests all run and pass, but nothing happens after Test Settings: Default Test Settings
is displayed in the command line. No results.xml
file is created and I can see no evidence of any sort of code coverage analysis.
Is it something simple I'm missing in the settings file? Or is this a more complicated problem?
Edit: Using Partcover version 2.2.36423
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我在评论中提到的,我怀疑您使用的是非常旧版本的partcover,它不支持.NET4。
此外,您会发现,如果升级到最新版本不起作用,则使用 /noisolation 开关会很有用。
您可能还会发现 OpenCover 会比 PartCover,因为它具有 32 位和 64 位支持以及支持 .NET2 和 .NET4 - 并且可以更好地处理目标进程,从而派生更多进程来做实际测试。
As I mentioned in the comments I suspect you are using a very old version of partcover which does not have .NET4 support.
In addition you will find that using the /noisolation switch would be useful should just upgrading to the latest version not work.
You may also find that OpenCover will work better than PartCover as it has 32 and 64 bit support as well as supporting .NET2 and .NET4 - and copes much better with target processes that spin off more processes to do the actual testing.