dotCover filter with command line

2.6k Views Asked by At

What is the correct way to call dotCover command runner passing it several filters?

I've tried the following but it only excludes the first assembly:

dotcover c /TargetExecutable="c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MsTest.exe" /TargetArguments="/testcontainer:c:\dev\SampleProject\UnitTests\bin\Debug\UnitTests.dll" /Output="c:\temp\Snapshot1.dcvr" /Filters="-:Assembly1, -:Assembly2"

it ignores anything after , in filter tag.

2

There are 2 best solutions below

1
Szabolcs Dézsi On BEST ANSWER

Try it with the following:

dotcover c /TargetExecutable="c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MsTest.exe" /TargetArguments="/testcontainer:c:\dev\SampleProject\UnitTests\bin\Debug\UnitTests.dll" /Output="c:\temp\Snapshot1.dcvr" /Filters="-:Assembly1;-:Assembly2"

Instead of comma and space as the separator, try it with semicolon.

0
Jeremy Thompson On

Another example as this was such a pain:

dotCover.exe dotnet --output=AppCoverageReport.html --reportType=HTML  --Filters="-:Company.Base.*;-:FluentValidation*;-:Dapper*;-:Spekt*;-:HealthChecks*"  --AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute;" -- test "Company.User.sln"