6

我试图从我的报告中删除一些包并且遇到了问题。

有人能给我一些帮助吗?

我在我的ant进程中使用 EMMA。


<!-- 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>


我试过使用:
<filter excludes="com.my.package.*"/>

没有成功:(

4

2 回答 2

10

Emma 允许在检测阶段使用过滤器来指定一组需要检测的文件。相反,您正在尝试在报告生成阶段执行此操作。上面给出的 链接描述了如何定义检测集。

我使用过这样的过滤器:

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

您还可以在 <instr> 下使用嵌套的 <filter> 元素

于 2009-07-08T12:06:42.103 回答
0

我假设您已经尝试过文档中的所有变体......?

如果是这样,我希望您可能有错字,或类似的东西。您能否提供正在使用的代码以及不起作用的排除语法,以及错误包含的类的源文件的标头?

于 2009-06-19T03:40:37.223 回答