How can I remove/filter/ignore some package from Emma (code coverage)
Asked Answered
L

2

6

I`m trying to remove some package from my report and having trouble.

Could some one give me some help?

I'm using EMMA in my ant process.


<!-- Generate the emma report both in xml and html -->
<emma>
  <report
    sourcepath="${build.report.src}"
    metrics="class:${coverage.classes.min},method:${coverage.methods.min}">     <fileset dir="${build.report.junit.data.dir}">
      <include name="*.emma"/>
    </fileset>
    <html outfile="${build.report.reports}/emma/raw.html" depth="method"/>
    <xml outfile="${build.report.tmp}/emma.xml" depth="method"/>
  </report>
</emma>


I`ve tried to use:
<filter excludes="com.my.package.*"/>

But with no success :(

Largehearted answered 19/6, 2009 at 2:35 Comment(0)
H
10

Emma allows the use of filters at instrumentation phase to specify a set of files that need to be instrumented. In contrast you are trying to do this at report generation phase. The link given above describes how to define the instrumentation set.

I've used filters like this:

<property name="emma.filter" value="-*.unittest.* -*.unittests.* -*.TST* -*TestCase -*Test -*TestSuite" />

<emma>
    <instr instrpath="${build.dir}"
        mode="overwrite"
        metadatafile="${build.dir}/coverage.em"
        filter="${emma.filter}" />
</emma>

You can also use nested <filter> elements under <instr>

Habanera answered 8/7, 2009 at 12:6 Comment(0)
C
0

I assume you've tried all of the variations in the documentation...?

If so, I expect that you may have a typo, or something like that. Can you provide the code you're using with the exclude syntax that doesn't work, and the header of the source file for the class that is incorrectly being included?

Cot answered 19/6, 2009 at 3:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.