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