如何删除/过滤/忽略来自艾玛(code覆盖)一些包 [英] How can I remove/filter/ignore some package from Emma (code coverage)

查看:265
本文介绍了如何删除/过滤/忽略来自艾玛(code覆盖)一些包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的试图从我的报告中删除了一些软件包并遇到了麻烦。

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

能有人给我一些帮助吗?

Could some one give me some help?

我在我的蚂蚁的过程中使用EMMA。


I'm using EMMA in my ant process.



<! - 同时生成XML和HTML的艾玛报告 - >结果
<艾玛>结果
  <报告结果
    源路径=$ {} build.report.src结果
    指标=类:$ {} coverage.classes.min,方法:$ {coverage.methods.min}>
    <文件集DIR =$ {build.report.junit.data.dir}>结果
      <*艾玛包括姓名= />结果
    < /文件集>结果
    < HTML OUTFILE =$ {} build.report.reports /emma/raw.html深度=方法/>结果
    < XML OUTFILE =$ {} build.report.tmp /emma.xml深度=方法/>结果
  < /报告>结果
< /艾玛>结果


<!-- 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试图用:
结果
&LT;过滤器会排除=com.my.package */>

但随着成功:(

推荐答案

艾玛允许以仪器阶段使用过滤器指定一组需要进行检测的文件。相反你想在生成报表阶段做到这一点。上述给出的链接描述了如何定义仪器集。

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>

您还可以使用嵌套&LT;滤光器&gt; INSTR&GT;及下LT元素

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

这篇关于如何删除/过滤/忽略来自艾玛(code覆盖)一些包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆