dotCover filter with command line
Asked Answered
G

2

7

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.

Geller answered 22/1, 2016 at 21:1 Comment(0)
M
9

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.

Mori answered 22/1, 2016 at 21:16 Comment(1)
that works thank you so much. I wish JetBrains page had this info. ThanksGeller
D
0

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"
Deposal answered 26/6, 2023 at 4:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.