How can I use filter for emma when building Android test with ant for a library project?

▼魔方 西西 提交于 2019-12-06 05:42:10

问题


From this question :

How can I use filter for emma when building Android test with ant?

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.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. Where should I add the 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


回答1:


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.

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.to.exclude.*" emma debug install test


来源:https://stackoverflow.com/questions/12506396/how-can-i-use-filter-for-emma-when-building-android-test-with-ant-for-a-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!