Ant emma 测试与android“无法找到要删除的文件coverage.em". [英] Ant emma test with android "Could not find file coverage.em to delete."

查看:15
本文介绍了Ant emma 测试与android“无法找到要删除的文件coverage.em".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Ant 和 Emma 为我的 android 项目设置代码覆盖率,并且我成功构建了项目,成功运行了测试,并生成了coverage.ec 文件,但覆盖率报告不是正在生成.当我运行 ant -verbose emma test 时,我得到了以下线索:

I'm trying to get code coverage set up for my android project with Ant and Emma, and I have the project successfully building, the tests successfully running, and the coverage.ec file generating, but the coverage reports aren't being generated. When I ran ant -verbose emma test I got the following clues:

[report] nothing to do: no metadata found in any of the data files
...
[delete] Could not find file /path/to/my/testProject/bin/coverage.em to delete.

我使用的是由 android 命令行工具生成的默认 build.xml 文件,它从 {sdk.dir}/tools/ant 目录导入一个非常大的 build.xml 文件.我将那里的信息与我在网上找到的片段进行了比较,一切似乎都井井有条.我错过了什么?如何生成coverage.em 文件?

I'm using the default build.xml file generated by the android command line tool, which imports a very large build.xml file from the {sdk.dir}/tools/ant directory. I've compared the info there to snippets I've found online and everything seems to be in order. What am I missing? How do I generate the coverage.em file?

推荐答案

我通过以下步骤成功获取覆盖率报告:

I get the coverage report successfully by following steps:

0.在我的系统上安装蚂蚁

0.install ant on my system

1.(在 sdk/tools 目录中)

1.(in the sdk/tools dir)

android update project -p <path to app project>

2.(在 sdk/tools 目录中)

2.(in the sdk/tools dir)

android update test-project -m <path to app project> -p <path to test project>

3.(在测试项目根目录下)

3.(in the test project root dir)

ant clean emma debug install test

4.报告是/bin/coverage.html

4.the report is /bin/coverage.html

这篇关于Ant emma 测试与android“无法找到要删除的文件coverage.em".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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