Android External Api Coverage not suitable

For the past 1 month, I have been trying to get a code coverage report for my Android project, which includes external jars (I work on ADT20). Whenever I run

ant test test emma debug install

It shows 100% coverage of my Android project, but there is no package and classes of my external cans in the coverage report. Can someone help me get a report on the coverage of packages and classes in external banks, either using the emma ant build, or any Android code coverage tool that ever does my job.

thanks

+4
source share
1 answer

The latest SDK uses emma, placing emma before building:

ant emma debug install ant emma debug install test 

The first is from your project director, and the second is from the test catalog. This will create a complete coverage report.

for more information see link

ADT r20-preview solves this problem by providing access to the full trajectory of classes of tested projects and their projects in the library:

http://tools.android.com/download/adt-20-preview

This will give you reports on code coverage in your library projects, but you will need to make some changes to the build.xml test target to attach the source files.

See this file for attaching an Android library to an Emma report (ant, emma) for more information on how to enable emma check coverage for your library projects at present.

Example-build.xml

 <emma> <!-- Grantland: Attach Android library project sources to the emma report --> <report sourcepath="${tested.project.absolute.dir}/${source.dir};${tested.android.library.source.dir}" verbosity="${verbosity}"> <!-- <report sourcepath="${tested.project.absolute.dir}/${source.dir}" verbosity="${verbosity}"> --> <!-- TODO: report.dir or something like should be introduced if necessary --> <infileset dir="."> <include name="coverage.ec" /> <include name="coverage.em" /> </infileset> <!-- TODO: reports in other, indicated by user formats --> <html outfile="coverage.html" /> </report> </emma> 

ant.properties

This may be a list of directories separated by semicolons.

 tested.android.library.source.dir=../library/src;etc 
+2
source

All Articles