mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-08 04:08:15 -05:00
updated target name "test" in tests/build.xml for Android SDK Tools Revision 20.0.3 / 21 RC4
This commit is contained in:
parent
677d5cd9bb
commit
04794c9c8e
@ -86,23 +86,56 @@
|
|||||||
|
|
||||||
<!-- This is overridden because otherwise it deletes coverage.em after extraction, requiring
|
<!-- This is overridden because otherwise it deletes coverage.em after extraction, requiring
|
||||||
another compile. Also, test.runner can be changed here instead of in ant.properties, and
|
another compile. Also, test.runner can be changed here instead of in ant.properties, and
|
||||||
the code to pull the results is integrated. Changes are commented because from looking at
|
the code to pull the results is integrated. This likely needs to be updated with every SDK
|
||||||
r20-preview, this might break and need to be redone. -->
|
SDK release. Copied from $ANDROID_SDK_HOME/tools/ant/build.xml, Android SDK Tools
|
||||||
|
Revision 20.0.3, and 21 RC4 is not changed. -->
|
||||||
<target name="test" depends="-test-project-check"
|
<target name="test" depends="-test-project-check"
|
||||||
description="OVERRIDE: Runs tests from the package defined in test.package property">
|
description="OVERRIDE: Runs tests from the package defined in test.package property">
|
||||||
|
<property name="test.runner" value="com.zutubi.android.junitreport.JUnitReportTestRunner" /><!-- ASH changed from original -->
|
||||||
|
|
||||||
<property name="tested.project.absolute.dir" location="${tested.project.dir}" />
|
<if condition="${project.is.test}">
|
||||||
|
<then>
|
||||||
|
<property name="tested.project.absolute.dir" location="${tested.project.dir}" />
|
||||||
|
|
||||||
<property name="test.runner" value="com.zutubi.android.junitreport.JUnitReportTestRunner" /><!-- changed from original -->
|
<!-- Application package of the tested project extracted from its manifest file -->
|
||||||
|
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
|
||||||
|
expression="/manifest/@package" output="tested.project.app.package" />
|
||||||
|
|
||||||
<!-- Application package of the tested project extracted from its manifest file -->
|
<if condition="${emma.enabled}">
|
||||||
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
|
<then>
|
||||||
expression="/manifest/@package" output="tested.manifest.package" />
|
<getprojectpaths projectPath="${tested.project.absolute.dir}"
|
||||||
<xpath input="AndroidManifest.xml"
|
binOut="tested.project.out.absolute.dir"
|
||||||
expression="/manifest/@package" output="manifest.package" />
|
srcOut="tested.project.source.absolute.dir" />
|
||||||
|
|
||||||
|
<getlibpath projectPath="${tested.project.absolute.dir}"
|
||||||
|
libraryFolderPathOut="tested.project.lib.source.path"
|
||||||
|
leaf="@{source.dir}" />
|
||||||
|
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</then>
|
||||||
|
<else>
|
||||||
|
<!-- this is a test app, the tested package is the app's own package -->
|
||||||
|
<property name="tested.project.app.package" value="${project.app.package}" />
|
||||||
|
|
||||||
|
<if condition="${emma.enabled}">
|
||||||
|
<then>
|
||||||
|
<property name="tested.project.out.absolute.dir" value="${out.absolute.dir}" />
|
||||||
|
<property name="tested.project.source.absolute.dir" value="${source.absolute.dir}" />
|
||||||
|
|
||||||
|
<getlibpath
|
||||||
|
libraryFolderPathOut="tested.project.lib.source.path"
|
||||||
|
leaf="@{source.dir}" />
|
||||||
|
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</else>
|
||||||
|
</if>
|
||||||
|
|
||||||
<property name="emma.dump.file"
|
<property name="emma.dump.file"
|
||||||
value="/data/data/${tested.manifest.package}/coverage.ec" />
|
value="/data/data/${tested.project.app.package}/coverage.ec" />
|
||||||
|
|
||||||
<if condition="${emma.enabled}">
|
<if condition="${emma.enabled}">
|
||||||
<then>
|
<then>
|
||||||
@ -114,44 +147,51 @@
|
|||||||
<arg value="${emma.dump.file}" />
|
<arg value="${emma.dump.file}" />
|
||||||
</extra-instrument-args>
|
</extra-instrument-args>
|
||||||
</run-tests-helper>
|
</run-tests-helper>
|
||||||
<echo>Downloading coverage file into project directory...</echo>
|
<echo level="info">Downloading coverage file into project directory...</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" />
|
||||||
<arg value="${emma.dump.file}" />
|
<arg value="${emma.dump.file}" />
|
||||||
<arg value="coverage.ec" />
|
<arg path="${out.absolute.dir}/coverage.ec" />
|
||||||
</exec>
|
</exec>
|
||||||
<echo>Extracting coverage report...</echo>
|
<echo level="info">Extracting coverage report...</echo>
|
||||||
|
|
||||||
|
<pathconvert property="tested.project.lib.source.path.value" refid="tested.project.lib.source.path">
|
||||||
|
<firstmatchmapper>
|
||||||
|
<regexpmapper from='^([^ ]*)( .*)$$' to='"\1\2"'/>
|
||||||
|
<identitymapper/>
|
||||||
|
</firstmatchmapper>
|
||||||
|
</pathconvert>
|
||||||
|
|
||||||
|
|
||||||
<emma>
|
<emma>
|
||||||
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
|
<report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}"
|
||||||
verbosity="${verbosity}">
|
verbosity="${verbosity}">
|
||||||
<!-- TODO: report.dir or something like should be introduced if necessary -->
|
<!-- TODO: report.dir or something like should be introduced if necessary -->
|
||||||
<infileset dir=".">
|
<infileset file="${out.absolute.dir}/coverage.ec" />
|
||||||
<include name="coverage.ec" />
|
<infileset file="${tested.project.out.absolute.dir}/coverage.em" />
|
||||||
<include name="coverage.em" />
|
|
||||||
</infileset>
|
|
||||||
<!-- TODO: reports in other, indicated by user formats -->
|
<!-- TODO: reports in other, indicated by user formats -->
|
||||||
<html outfile="coverage.html" />
|
<html outfile="${out.absolute.dir}/coverage.html" />
|
||||||
<xml outfile="coverage.xml" />
|
<xml outfile="${out.absolute.dir}/coverage.xml" /><!-- ASH added for JUnitReportTestRunner -->
|
||||||
</report>
|
</report>
|
||||||
</emma>
|
</emma>
|
||||||
<!-- commented out from original
|
<!-- ASH commented out from original
|
||||||
<echo>Cleaning up temporary files...</echo>
|
<echo level="info">Cleaning up temporary files...</echo>
|
||||||
<delete file="coverage.ec" />
|
<delete file="${out.absolute.dir}/coverage.ec" />
|
||||||
<delete file="coverage.em" />
|
<delete file="${out.absolute.dir}/coverage.em" />
|
||||||
-->
|
-->
|
||||||
<echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>
|
<echo level="info">Saving the report file in ${out.absolute.dir}/coverage.html</echo>
|
||||||
</then>
|
</then>
|
||||||
<else>
|
<else>
|
||||||
<run-tests-helper />
|
<run-tests-helper />
|
||||||
</else>
|
</else>
|
||||||
</if>
|
</if>
|
||||||
<!-- added for JUnitReportTestRunner: -->
|
<!-- ASH the rest added for JUnitReportTestRunner: -->
|
||||||
<echo>Saving the JUnit test report as ${junit-file}</echo>
|
<echo>Saving the JUnit test report as ${junit-file}</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" />
|
||||||
<arg value="/data/data/${tested.manifest.package}/files/junit-report.xml" />
|
<arg value="/data/data/${tested.project.app.package}/files/junit-report.xml" />
|
||||||
<arg value="${junit-file}" />
|
<arg value="${junit-file}" />
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
Loading…
Reference in New Issue
Block a user