使用 Moles 进行的测试没有代码覆盖率信息
过去几天我已经习惯了 OpenCover,我是否注意到使用 Moles 进行的测试不会生成任何覆盖率信息。
我创建了一个小解决方案来隔离问题,并发现仅针对没有 [HostType("Moles")]
属性的测试生成代码覆盖率。
阅读周围我发现这个 和 this 这似乎是我的问题的 NCover 等价物。他们说这与 Moles 运行分析器和覆盖工具有关,并且有一个环境变量 CLRMONITOR_EXTERNAL_PROFILERS 可以设置为允许多个分析器同时运行痣 - 我认为这就是解决方案所在,但我不是 100% 确定。 我猜想该变量的值将是 OpenCover 探查器的名称 - 有人知道这个名称吗?
有人设法让 OpenCover 与 Moles 一起运行吗?能做到吗?
I have been getting used to OpenCover over the past few days, and have I noticed that tests using Moles do not generate any Coverage information.
I have created a small solution to isolate the problem, and have found that code coverage is generated only for tests that do not have the [HostType("Moles")]
attribute.
Reading around I have found this and this which seem to be NCover equivalents of my problem. They say that it is something to do with Moles running a profiler as well as the coverage tool, and that there is an environment variable CLRMONITOR_EXTERNAL_PROFILERS
that can be set to allow multiple profilers to run at the same time as Moles - I think that this is where the solution lies, but I'm not 100% sure.
I guess that the variable's value would be the name of the OpenCover profiler - does anyone know this name?
Has anyone managed to get OpenCover running with Moles? Can it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要的探查器的名称可能是 CLSID。
尝试将环境变量设置为 1542C21D-80C3-45E6-A56C-A9C1E4BEB7B8
The name of the profiler you need is probably the CLSID.
Try setting the environment variable to 1542C21D-80C3-45E6-A56C-A9C1E4BEB7B8