No Code Coverage Information for Tests Using Moles

随声附和 提交于 2019-11-27 08:56:27

问题


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?


回答1:


The name of the profiler you need is probably the CLSID.

Try setting the environment variable to 1542C21D-80C3-45E6-A56C-A9C1E4BEB7B8



来源:https://stackoverflow.com/questions/7013990/no-code-coverage-information-for-tests-using-moles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!