This Question is Answered

2 "helpful" answers available (2 pts)
2 Replies Last post: Jan 22, 2014 2:49 PM by Michael Wagner  
Michael Wagner Newbie 6 posts since
Nov 16, 2012
Currently Being Moderated

Jan 21, 2014 11:54 PM

Problems using

Hi,

 

I am currently running dotCover from commandline in order to integrate it into our CI build environment.

Everything is working fine except that I cannot get the attribute based exclusion to work.

 

This is my configuratoin XML and I want to exclude

* ExcludeFromCodeCoverage

* Averything autoamtically generated

 

<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <Executable>
    <![CDATA[%MSTESTEXE%]]>
  </Executable>
  <WorkingDir>
    <![CDATA[%WORKDIR%]]>
  </WorkingDir>
  <Arguments>
    <![CDATA[/Testcontainer:"%ASSEMBLY%"]]>
  </Arguments>
  <Output>
    <![CDATA[%COVEROUTPUT%]]>
  </Output>
  <Filters>
    <IncludeFilters>
      <FilterEntry>
        <!--  _ "Module" means project _ -->
        <ModuleMask>*</ModuleMask>
      </FilterEntry>
    </IncludeFilters>
    <ExcludeFilters>
      <FilterEntry>
        <!--  _ "Module" means project _ -->
        <ModuleMask>*Test*</ModuleMask>
      </FilterEntry>
      <!--<FilterEntry>
        --><!-- namespaces can be filter with a ClassMask with * wildcard --><!--
        <ClassMask>Namespaces.For.AutogeneratedCode.*</ClassMask>
      </FilterEntry>
      <FilterEntry>
        <ClassMask>SomeUntestable.Class</ClassMask>
      </FilterEntry>-->
      <AttributeFilters>
        <AttributeFilterEntry>*ExcludeFromCodeCoverage*;*CompilerGenerated*;*GeneratedCode*</AttributeFilterEntry>
        <!--<AttributeFilterEntry>
          <ModuleMask> Module mask </ModuleMask>
          <ClassMask>*ExcludeFromCodeCoverage*;*CompilerGenerated*;*GeneratedCode*</ClassMask>
        </AttributeFilterEntry>-->
      </AttributeFilters>
      <!--<AttributeFilter>
        <ClassMask>*ExcludeFromCodeCoverage*</ClassMask>
        <ClassMask>*CompilerGenerated*</ClassMask>
        <ClassMask>*GeneratedCode*</ClassMask>
      </AttributeFilter>-->
    </ExcludeFilters>
  </Filters>
  <ReportType>html</ReportType>
</AnalyseParams>

 

What am I doing wrong?


Thanks

Michael

Ekaterina Solovova JetBrains 34 posts since
Jun 26, 2012
Currently Being Moderated
Jan 22, 2014 1:26 PM in response to: Michael Wagner
Re: Problems using

Hello Michael,

 

I can see two mistakes in your configuration XML:

1. Please specify Filters and AttributeFilters separately:

  <Filters>
    <IncludeFilters>...</IncludeFilters>
    <ExcludeFilters>...</ExcludeFilters>
  </Filters>
  <AttributeFilters>

    <AttributeFilterEntry>...</AttributeFilterEntry>
  </AttributeFilters>

 

2. Please specify each attribute mask in a separate AttributeFilterEntry tag:

  <AttributeFilters>

    <AttributeFilterEntry>*ExcludeFromCodeCoverage*</AttributeFilterEntry>

    <AttributeFilterEntry>*CompilerGenerated*</AttributeFilterEntry>

    <AttributeFilterEntry>*GeneratedCode*</AttributeFilterEntry>
  </AttributeFilters>

 

Please let me know whether it helps.

Best regards.

More Like This

  • Retrieving data ...