使用 Moles 进行的测试没有代码覆盖率信息

发布于 2024-11-29 04:20:46 字数 614 浏览 3 评论 0原文

过去几天我已经习惯了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妄想挽回 2024-12-06 04:20:46

您需要的探查器的名称可能是 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文