Can Opencover be used with TypeMock Isolator?

后端 未结 1 958
醉梦人生
醉梦人生 2021-01-19 00:34

I\'m looking for a .NET coverage tool, and had been trying out PartCover, with mixed success. I see that OpenCover is intended to replace PartCover, but I\'ve so far been un

相关标签:
1条回答
  • 2021-01-19 01:03

    Note: I work at Typemock

    I poked around with the configuration a little bit and managed to get OpenCover to run nicely with Isolator. Here's what you can do to make them work together, until we add official support:

    1. Register OpenCover profiler by running runsvr32 OpenCover.Profiler.dll (you will need an Administrator's access for this).
    2. Locate the file typemockconfig.xml, it should be under your installation directory, typically C:\Program Files (x86)\Typemock\Isolator\6.0.
    3. Edit the file, and add the following entry towards the end of the file, above </ProfilerList>:
    <Profiler Name="OpenCover" Clsid="{1542C21D-80C3-45E6-A56C-A9C1E4BEB7B8}" DirectLaunch="false">
      <EnvironmentList />
    </Profiler>
    

    Save the file, you will now have a new entry in the Typemock Configuration utility, called OpenCover. Press the Link button to link them. You will now be able to run your tests using OpenCover.Console.exe and Isolator. For example, here's how to run your tests with MSTest:

    OpenCover.Console.exe 
    -target:"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"
    -targetargs:"/testcontainer:"d:\code\myproject\mytests.dll"   
    -output:opencovertests.xml
    

    There is still a minor issue running this with TMockRunner -link (that is, with late linking). I will need to look at it further at work.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题