艾玛code覆盖在Android上一个lib [英] Emma code coverage for a lib on Android

查看:224
本文介绍了艾玛code覆盖在Android上一个lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个Android应用程序,这使得库jar文件调用一些单元测试。我想看到的code覆盖罐子,但是当我运行ant艾玛,并期待在coverage.html,它仅在应用项目的覆盖报告。

I currently have some unit tests for an Android app, which makes calls to a library jar file. I would like to see the code coverage for the jar, but when I run ant emma and look at the coverage.html, it only reports on the coverage of the app project.

有没有指定我想查看覆盖罐子以及一种方式?

Is there a way to specify that I would like to view the coverage for the jar as well?

推荐答案

在ADT R20- preVIEW通过给进入测试项目的全部类路径和库项目解决了这个问题:

The ADT r20-preview solves this issue by giving access to the full classpath of tested projects and their Library Projects:

http://tool​​s.android.com/download/adt-20 - preVIEW

在蚂蚁修正:


      
  • 测试项目现在已经从测试项目,包括库项目和第三方罐子访问完整的类路径

  •   
  • 嵌入测试应用程序现在可以部署和测试,包括code覆盖,像测试应用。

  •   

这会给你在你的库项目code覆盖报告,但你必须做的测试的一些修改 目标的build.xml 来的源文件太重视。请参见安装的Andr​​oid库项目源$ C ​​$ C艾玛报告(蚂蚁,艾玛)关于如何将艾玛测试覆盖率为你的库项目暂时的更多信息。

This will give you code coverage reports on your library projects, but you will have to do some modifying of the test target of build.xml to attach the source files too. See Attach Android library project source code to Emma report (ant, emma) for more information on how to incorporate emma test coverage for your library projects for the time being.

这篇关于艾玛code覆盖在Android上一个lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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