Domanda

I have been trying from past 1 month for deducing the Code coverage report of my Android Project which includes External Jars.(I am running on ADT20). Whenever I run

ant emma debug install test

It Shows 100% coverage for my Android project but the coverage report does not contain the Package and classes of my External Jars. Can any one help me to get the coverage report of Packages and Classes in External Jars either by emma ant build or any Android Code coverage tool, which ever gets my work done.

Thanks

È stato utile?

Soluzione

The newest SDK uses emma by putting emma in front of the build:

ant emma debug install
ant emma debug install test

The first is run from your project director, the second the test directory. Doing so will generate the full coverage report.

for more information see this link

The ADT r20-preview solves this issue by giving access to the full classpath of tested projects and their Library Projects:

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

This will give you code coverage reports on your library projects, but you will have to do some modifying of the test target of build.xml to attach the source files too.

See this Attach Android library project source code to Emma report (ant, emma) for more information on how to incorporate emma test coverage for your library projects for the time being.

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 can be a semicolon delimited list of directories

tested.android.library.source.dir=../library/src;etc
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top