如何使用过滤器艾玛库项目建设的Andr​​oid测试蚂蚁的时候? [英] How can I use filter for emma when building Android test with ant for a library project?

查看:129
本文介绍了如何使用过滤器艾玛库项目建设的Andr​​oid测试蚂蚁的时候?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从这个问题:

<一个href="http://stackoverflow.com/questions/7360972/how-can-i-use-filter-for-emma-when-building-android-test-with-ant">How我可以使用过滤器,艾玛建设的Andr​​oid测试蚂蚁的时候?

我知道,艾玛可以通过添加以下行到我的目标项目ant.properties,而不是测试项目,

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.

我的工作区是这样的:

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

当我运行覆盖LIB1我也得到覆盖文件LIB2和lib3,我不想要的。 我应该在哪里加emma.filter? 我试图把它在每一个这些项目的根本,但它没有工作至今。

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

推荐答案

刚刚有同样的问题,我想你提到的线程的解决方案,我没有工作。 我也试图直接在build.xml文件中添加它,也没擦出火花。

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.

虽然我设法让它通过添加 -Demma.filter =工作 - your.app.package蚂蚁命令行:

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

这篇关于如何使用过滤器艾玛库项目建设的Andr​​oid测试蚂蚁的时候?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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