Ant emma test with android “Could not find file coverage.em to delete.”

不羁的心 提交于 2019-12-13 21:08:34

问题


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.

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?


回答1:


I get the coverage report successfully by following steps:

0.install ant on my system

1.(in the sdk/tools dir)

android update project -p <path to app project>

2.(in the sdk/tools dir)

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

3.(in the test project root dir)

ant clean emma debug install test

4.the report is /bin/coverage.html



来源:https://stackoverflow.com/questions/24191161/ant-emma-test-with-android-could-not-find-file-coverage-em-to-delete

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