Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add filters to OpenCover tool to skip some of the classes in a namespace

How can I add filters to skip some of the classes in a namespace/assembly. For example: SYM.UI is the base assembly and i want to skip SYM.UI.ViewModels. Writing the below filter but it is including all of them and not fulfilling my request:

+[SYM.UI*]* -[SYM.UI.ViewModels*]*

Kindly help me correcting this?

like image 803
Ravindra Avatar asked Jul 26 '11 12:07

Ravindra


1 Answers

The opencover wiki is a good place to start.

The usage is described as +/-[modulefilter]typefilter (this is based on how you would see the types in IL; where the type filter also includes the namespace and module filter usually is the name of the assembly (without the file extension).

Thus to exclude your types you could use

+[SYM.UI]* -[SYM.UI]SYM.UI.ViewModels.*

NOTE: Exclusion filters take preference over inclusion filters.

like image 82
Shaun Wilde Avatar answered Sep 18 '22 17:09

Shaun Wilde