Opencover可以与TypeMock隔离器一起使用吗? [英] Can Opencover be used with TypeMock Isolator?

查看:109
本文介绍了Opencover可以与TypeMock隔离器一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找.NET覆盖工具,并且一直在尝试PartCover,但取得了不同的成功. 我看到 OpenCover 用于替换PartCover,但是到目前为止,我仍无法将其与TypeMock隔离器链接,因此我嘲笑的是-收集覆盖范围信息时通过测试.

我尝试复制Partcover的设置,但是没有定义的配置文件名称与Isolator的"link"参数一起使用.以为OpenCover是基于Partcover的,我试图告诉Isolator与Partcover链接,但它没有抱怨(我仍然安装了Partcover),但是链接没有用-Isolator认为它不存在. >

我错过了一步吗?有解决方法吗?还是我必须等待与OpenCover成为朋友的Isolator版本?

解决方案

注意:我在Typemock工作

我仔细研究了一下配置,并设法使OpenCover与Isolator一起很好地运行.在我们添加官方支持之前,可以执行以下操作使它们一起工作:

  1. 通过运行runsvr32 OpenCover.Profiler.dll注册OpenCover探查器(您将需要管理员访问权限).
  2. 找到文件typemockconfig.xml,该文件应位于您的安装目录下,通常为C:\Program Files (x86)\Typemock\Isolator\6.0.
  3. 编辑文件,并在文件末尾的</ProfilerList>上方添加以下条目:

<Profiler Name="OpenCover" Clsid="{1542C21D-80C3-45E6-A56C-A9C1E4BEB7B8}" DirectLaunch="false">
  <EnvironmentList />
</Profiler>

保存文件,现在在Typemock配置实用程序中将有一个名为OpenCover的新条目.按链接按钮链接它们.现在,您将可以使用OpenCover.Console.exe和Isolator运行测试.例如,以下是使用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

使用TMockRunner -link运行此文件仍然存在一个小问题(即,后期链接).我将需要在工作中进一步研究它.

希望有帮助.

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 unable to link it with TypeMock Isolator so my mocked-out tests pass while gathering coverage info.

I tried replicating my setup for Partcover, but there's no defined profilename that works with the "link" argument for Isolator. Thinking that OpenCover was based on Partcover, I tried to tell Isolator to link with Partcover, and it didn't complain (I still had Partcover installed), but the linking didn't work - Isolator thought it wasn't present.

Am I missing a step? Is there a workaround? Or must I wait for an Isolator version that is friends with OpenCover?

解决方案

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.

这篇关于Opencover可以与TypeMock隔离器一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆