diff options
Diffstat (limited to 'files')
-rw-r--r-- | files/ant/build.xml | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index 699fb58..6bda75b 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -1256,7 +1256,7 @@ <if condition="${emma.enabled}"> <then> - <echo>WARNING: Code Coverage is currently only supported on the emulator and rooted devices.</echo> + <echo>Running tests...</echo> <run-tests-helper emma.enabled="true"> <extra-instrument-args> <arg value="-e" /> @@ -1264,6 +1264,17 @@ <arg value="${emma.dump.file}" /> </extra-instrument-args> </run-tests-helper> + + <echo level="info">Settting permission to download the coverage file...</echo> + <exec executable="${adb}" failonerror="true"> + <arg line="${adb.device.arg}" /> + <arg value="shell" /> + <arg value="run-as" /> + <arg value="${tested.project.app.package}" /> + <arg value="chmod" /> + <arg value="644" /> + <arg value="${emma.dump.file}" /> + </exec> <echo level="info">Downloading coverage file into project directory...</echo> <exec executable="${adb}" failonerror="true"> <arg line="${adb.device.arg}" /> @@ -1271,7 +1282,6 @@ <arg value="${emma.dump.file}" /> <arg path="${out.absolute.dir}/coverage.ec" /> </exec> - <echo level="info">Extracting coverage report...</echo> <pathconvert property="tested.project.lib.source.path.value" refid="tested.project.lib.source.path"> <firstmatchmapper> @@ -1280,7 +1290,7 @@ </firstmatchmapper> </pathconvert> - + <echo level="info">Extracting coverage report...</echo> <emma> <report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}" verbosity="${verbosity}"> @@ -1294,6 +1304,14 @@ <echo level="info">Cleaning up temporary files...</echo> <delete file="${out.absolute.dir}/coverage.ec" /> <delete file="${out.absolute.dir}/coverage.em" /> + <exec executable="${adb}" failonerror="true"> + <arg line="${adb.device.arg}" /> + <arg value="shell" /> + <arg value="run-as" /> + <arg value="${tested.project.app.package}" /> + <arg value="rm" /> + <arg value="${emma.dump.file}" /> + </exec> <echo level="info">Saving the report file in ${out.absolute.dir}/coverage.html</echo> </then> <else> |