如何排除类型和方法在TeamCity的被覆盖dotCover? [英] How do I exclude types and methods from being covered by dotCover in TeamCity?

查看:173
本文介绍了如何排除类型和方法在TeamCity的被覆盖dotCover?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我已经使用TestDriven.Net和Visual Studio覆盖功能,即随着测试检查测试覆盖现有的C#4的项目 - 从上下文菜单>覆盖

I've got an existing C# 4 project which I've checked the test coverage for by using TestDriven.Net and the Visual Studio coverage feature, i.e. Test With -> Coverage from the context menu.

该项目包含一些代码,我不想覆盖,我已经解决了通过添加 [ExcludeFromCodeCoverage] 对于那些类型和方法。

The project contains some code I don't want covered, and I've solved that by adding the [ExcludeFromCodeCoverage] for those types and methods.

我们刚刚升级的TeamCity到6.0.3,和我添加dotCover覆盖到NUnit的生成步骤。

We've just upgraded TeamCity to 6.0.3, and I've added dotCover coverage to the NUnit build step.

我已经成功地去除覆盖的外部组件,例如在NHibernate的过滤器一节(由明确规定的,我想覆盖的组件),但我有如何排除类型和方法挣扎从覆盖的组件。

I've managed to remove coverage for external assemblies such as NHibernate in the "Filters" section (by explicitly state the assemblies for which I want coverage), but I'm struggling with how to exclude types and methods from covered assemblies.

推荐答案

好吧,马丁,我想它了!只用了在过滤器语法随机戳......当文件说,一个小时增加这样一个过滤器

Ok, Martin, I figured it out! It only took an hour of randomly poking at the filter syntax... when the documentation says to add a filter like this

+:myassembly=*;type=*;method=***

,他们真的是这样...如有任何事情在<> 是由你完全更换和其他任何为文字

They really mean this... where anything in <> is replaced entirely by you and anything else is a literal

+:<myassembly>;type=<filter>;method=<filter>



所以,我想要的过滤器将包括一个单一的组件(从一堆组件),然后排除该装配几个命名空间。我写了

So, the filter I wanted was to include a single assembly (from a bunch of assemblies) and then exclude a few namespaces in that assembly. I wrote

+:Omnyx.Scanner
-:Omnyx.Scanner;type=Omnyx.Scanner.Simulation.*
-:Omnyx.Scanner;type=Omnyx.Scanner.ToolsCommon.*

这篇关于如何排除类型和方法在TeamCity的被覆盖dotCover?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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