Question

As of dotCover 2.0, there is support for attribute filters. This basically allows you to exclude any code marked with a certain filter from your coverage report. There is okay documentation out there for this usage, notably on the TeamCity documentation where they cover integration with dotCover.

The basic syntax used there is -:myAttributeName or -:module=myModuleName;myAttributeName to exclude an attribute or an attribute within a module respectively. This doesn't work when passed to the dotCover console runner. The coverage report still shows the excluded code.

Does dotCover support the attribute filter in its console (I assume so since TeamCity basically just passes the arguments through to the console runner) and is there a known syntax that works for it?

Was it helpful?

Solution

Attribute filters specification differs a bit in dotCover console runner and in TeamCity. In dotCover you can use the following command line key: /AttributeFilters=ARG

ARG has the following syntax: attribute1;[module]attribute2;... where "attribute" is fully qualified attribute type name (asterisk wildcards (*) are supported), and "module" is an optional parameter which specifies name of the assembly where attribute was defined.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top