code覆盖率为Android [英] Code coverage for Android

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

问题描述

可能重复:
   Android的测试code覆盖,Eclipse的

它真的令人沮丧,看看有没有文件,了解怎样使用EMMA在Eclipse的Andr​​oid应用程序。有没有人设法与EMMA在Eclipse的Andr​​oid应用程序的工作?如果没有检查出整个Android的源代码,做所有的两轮牛车?

Its really frustrating to see there is no documentation for how to use EMMA for Android apps in Eclipse. Has anyone managed to work with EMMA in eclipse for Android apps? Without checking out the whole android source and do all the hackery?

推荐答案

如果你有<道路测试项目>。/build.xml 文件重命名为

我能够通过执行从控制台下面生成测试覆盖率报告:

I was able to generate test coverage report by executing following from the console:

&LT;路径到Android工具&gt; Android的更新测试项目-m&LT;路径应用项目&GT; -p&LT;道路测试项目&GT; + <大骨节病>输入

CD&LT;道路测试项目&GT; + <大骨节病>输入

蚂蚁艾玛调试安装测试 + <大骨节病>输入

其中,&LT;路径到Android工具&gt; 的/ opt / Android的SDK-Linux的/工具/ 上我的机器 - 安装了Android SDK中的文件夹

where <path to android tools> is /opt/android-sdk-linux/tools/ on my machine - the folder where android SDK is installed.

这生成&LT;道路测试项目&GT;。/bin/coverage.html 文件

如果你得到错误JAVA_HOME错误执行 gksu gedit中的/ etc /环境 + <大骨节病>输入,正确 JAVA_HOME ,保存文件,注销或重新启动,然后重试。

If you get "wrong JAVA_HOME" error execute gksu gedit /etc/environment + Enter, correct JAVA_HOME, save the file, log out or reboot and try again.

来源:<一href="http://blog.rabidgremlin.com/2010/11/19/android-tips-generating-a-coverage-report-for-your-unit-tests/" rel="nofollow">http://blog.rabidgremlin.com/2010/11/19/android-tips-generating-a-coverage-report-for-your-unit-tests/

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

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