java – 如何从Emma中删除/过滤/忽略某些包(代码覆盖率)

我试图从我的报告中删除一些包并遇到麻烦.

有人可以给我一些帮助吗?

我在我的蚂蚁过程中使用emmA.

<! - 在xml和html中生成emma报告 - >
<艾玛>
<报告
源路径= “${} build.report.src”
度量= “类:${coverage.classes.min},方法:${coverage.methods.min}” >
< fileset dir =“${build.report.junit.data.dir}”>
< include name =“*.emma”/>
< /文件集>
< html outfile =“${build.report.reports} /emma/raw.html”depth =“method”/>
< xml outfile =“${build.report.tmp} /emma.xml”depth =“method”/>
< /报告>
< /艾玛>

我试过用:

< filter excludes =“com.my.package.*”/>

但没有成功:(

解决方法

emma允许在检测阶段使用过滤器来指定需要检测的一组文件.相反,您正在尝试在报告生成阶段执行此操作. link given above描述了如何定义检测集.

我用过这样的过滤器:

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

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

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...