问题
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