Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
android test_rules_coverage-target
test_rules is incorrect for coverage target for the coverage file locations and report generation..correcteed to:
<target name="coverage" depends="-set-coverage-classpath, -install-instrumented, install"
description="Runs the tests against the instrumented code and generates
code coverage report">
<run-tests-helper emma.enabled="true">
<arg value="-e" />
<arg value="coverageFile" />
<arg value="${emma.dump.file}" />
<echo>Downloading coverage file into project directory...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="pull" />
<arg value="${emma.dump.file}" />
<arg value="" />
<echo>Extracting coverage report...</echo>
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
<!-- TODO: report.dir or something like should be introduced if necessary -->
<!-- per sdk 11/adt 10.01 its wrong
<infileset file="${tested.project.absolute.dir}/build/docs/" />
<infileset file="${tested.project.absolute.dir}/coverage.em"/>
<!-- TODO: reports in other, indicated by user formats -->
<html outfile="${tested.project.absolute.dir}/build/docs/coverage.html" />
<echo>Cleaning up temporary files...</echo>
<delete dir="${instrumentation.absolute.dir}" />
<!-- file appears in build/docs and
coverage.em appears in app project/root
thus we need to specify location-->
<delete file="${tested.project.absolute.dir}/build/docs/" />
<delete file="${tested.project.absolute.dir}/coverage.em" />
<echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.