Fix for coverage target, bring in .em file

pull/14/head
Tim Su 13 years ago
parent 2f595291df
commit 72a8beb956

@ -47,13 +47,15 @@
<!-- build and install an instrumented build -->
<target name="install-instrumented">
<property name="tested.project.absolute.dir" location="${tested.project.dir}" />
<subant target="clean instrument install">
<fileset file="../astrid/build.xml" />
<fileset file="${tested.project.absolute.dir}/build.xml" />
</subant>
<copy todir="." file="${tested.project.absolute.dir}/coverage.em" />
</target>
<!-- override coverage target with custom reporting and rules -->
<target name="coverage" depends="-test-project-check, install-instrumented"
<target name="coverage" depends="-test-project-check"
description="Runs the tests against the instrumented code and generates
code coverage report">
@ -76,13 +78,28 @@
<arg value="${emma.dump.file}" />
</extra-instrument-args>
</run-tests-helper>
<property name="tested.project.absolute.dir" location="${tested.project.dir}" />
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
expression="/manifest/@package" output="tested.manifest.package" />
<echo>Downloading coverage file into project directory...</echo>
<property name="emma.dump.file"
value="/data/data/${tested.manifest.package}/coverage.ec" />
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="pull" />
<arg value="${emma.dump.file}" />
<arg value="coverage.ec" />
</exec>
<copy todir="." file="${tested.project.absolute.dir}/coverage.em" />
<antcall target="emma-parse" />
<antcall target="pull-junit" />
</target>
<target name="emma-parse" depends="-test-project-check">
<echo>Extracting coverage report...</echo>
<copy todir="${tested.project.absolute.dir}/src-combined">
<fileset dir="../api/src" includes="**/*.java" />
@ -103,11 +120,10 @@
<delete file="coverage.ec" />
<delete file="coverage.em" />
<echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>
<antcall target="pull-junit" />
</target>
<target name="pull-junit">
<echo>Extracting junit report...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}"/>
<arg value="pull" />

Loading…
Cancel
Save