views:

998

answers:

3

Hi all...

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 :(

A: 

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?

John Weldon
+1  A: 

Emma allows to use 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 points to the description of defining 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>

wheleph
A: 

How to mention recursive packages for exclude filter

archana