dotcover analyse with filter fails

I'm using currently dotcover v2.0.425.62. When I execute dotcover analyse <myxmlcoverage> and my xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <TargetExecutable>C:\Program Files\Gallio\bin\Gallio.Echo.exe</TargetExecutable>
  <TargetArguments>/report-type:xml /rnf:gallio-report /runtime-version:v4.0.30319 *Tests.dll </TargetArguments>
  <TargetWorkingDir>Tests\</TargetWorkingDir>
  <Output>coveroutput.xml</Output>
  <ReportType>
 XML<!-- [HTML|JSON|XML|NDependXML]. A type of the report. XML by default. -->
  </ReportType>
  <InheritConsole>
 <!-- [True|False] Lets the application being analysed to inherit dotCover console. True by default. -->
  </InheritConsole>
  <AttributeFilters>
 <AttributeFilterEntry>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage</AttributeFilterEntry>
  </AttributeFilters>
</AnalyseParams>

The coverouput.xml is generated, but with a lot of stuff I do not need.
So I added few filters and now my xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <TargetExecutable>C:\Program Files\Gallio\bin\Gallio.Echo.exe</TargetExecutable>
  <TargetArguments>/report-type:xml /rnf:gallio-report /runtime-version:v4.0.30319 *Tests.dll </TargetArguments>
  <TargetWorkingDir>Tests\</TargetWorkingDir>
  <Output>coveroutput.xml</Output>
  <ReportType>
 XML<!-- [HTML|JSON|XML|NDependXML]. A type of the report. XML by default. -->
  </ReportType>
  <InheritConsole>
 <!-- [True|False] Lets the application being analysed to inherit dotCover console. True by default. -->
  </InheritConsole>
  <Filters>
 <ExcludeFilters>
   <FilterEntry>
 <ModuleMask>Gallio</ModuleMask>
 <ClassMask>*</ClassMask>
 <FunctionMask>*</FunctionMask>
   </FilterEntry>
   <FilterEntry>
 <ModuleMask>*.Tests</ModuleMask>
 <ClassMask>*</ClassMask>
 <FunctionMask>*</FunctionMask>
   </FilterEntry>
 </ExcludeFilters>
  </Filters>
  <AttributeFilters>
 <AttributeFilterEntry>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage</AttributeFilterEntry>
  </AttributeFilters>
</AnalyseParams>

When I execute it again, the coverouput is always empty.
I tried only with one of these filter each time as well, but without any success.
After it I tried it with dotcover v2.5 and it worked immediately. But I have to use v2.0 of dotcover.

So why analyse does not work any more when have set a filter?

1 comment

Hi Patrick,

Thank you for contacting us.
Older versions of dotCover should have include filter to work properly.
So, please add following in your xml:

<IncludeFilters>
   <FilterEntry>
<ModuleMask>*</ModuleMask>
<ClassMask>*</ClassMask>
<FunctionMask>*</FunctionMask>
   </FilterEntry>
</IncludeFilters>

Please let me know your results.

Regards.

0

Please sign in to leave a comment.