[英]How can I use filter for emma when building Android test with ant for a library project?
From this question : 从这个问题:
How can I use filter for emma when building Android test with ant? 使用Ant构建Android测试时,如何使用Emma过滤器?
I know emma can use a filter by adding the following lines to my ant.properties of the targeted project, not the test project, 我知道Emma可以使用过滤器,方法是将以下行添加到目标项目(而不是测试项目)的ant.properties中,
emma.filter=-com.your.excluded.package.*
but it seems it doesn't work properly if my target project is a library project. 但是,如果我的目标项目是一个图书馆项目,它似乎无法正常工作。
My workspace looks like this: 我的工作区如下所示:
projectlib1 : lib project using lib2
projectlib1/tests : unit tests for lib1
projectlib2 : lib project using lib3
projectlib2/tests : unit tests for lib2
projectlib3 : stand alone lib
When I run coverage for lib1 I also get coverage files for lib2 and lib3 which I do not want. 当我运行lib1的coverage时,我还会得到我不需要的lib2和lib3的coverage文件。 Where should I add the emma.filter? 我应该在哪里添加emma.filter? I tried putting it at the root of each of those projects but it did not work so far. 我尝试将其放在每个项目的根源,但到目前为止还没有奏效。
any suggestion welcome! 任何建议欢迎! thank you 谢谢
Just had the same problem, I tried the solution of the thread you mention and I did not work. 只是有同样的问题,我尝试了您提到的线程的解决方案,但我没有工作。 I also tried to add it directly in the build.xml file, did not work either. 我也尝试将其直接添加到build.xml文件中,也没有用。
Although I managed to make it work by adding the -Demma.filter="-your.app.package"
on the ant command line: 尽管我设法通过在ant命令行上添加-Demma.filter="-your.app.package"
使其工作:
ant -Demma.filter="-your.app.package.to.exclude.*" emma debug install test
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.