ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Ant intergrate with Android Unit Test building
Date Thu, 05 Aug 2010 06:17:29 GMT


Ant used by Java web or java application, when building the Unit test.
It can create a .html file to show the result.

      <target name="junit" depends="instrument" description="Junit">

            <!--<junit haltonfailure="no" printsummary="on"
errorProperty="test.failed" failureProperty="test.failed"

            <junit printsummary="yes" haltonfailure="no" fork="true">

                  <sysproperty key="emma.coverage.out.file"
value="${coverage.absolute.dir}/coverage.emma" />


                  <jvmarg value="-Demma.coverage.out.merge=true" />

                  <classpath location="${instrument.absolute.dir}" />

                  <classpath location="${out.test-classes.absolute.dir}"

                  <classpath refid="emma.lib" />

                  <formatter type="xml" />

                  <batchtest todir="${junit.absolute.dir}"

                        <fileset dir="${out.test-classes.absolute.dir}">

                             <include name="**/*Test.class" />





                  <fileset dir="${junit.absolute.dir}">

                        <include name="TEST-*.xml" />


                  <report format="frames" todir="${junit.absolute.dir}"


            <fail if="test.failed">

                  Tests failed. Check ${junit.absolute.dir}


            <antcall target="checkstyle" />

            <antcall target="findbugs" />

            <antcall target="build_html" />

            <antcall target="pmd" />

            <antcall target="gen-report-coverage" />



But when building the Android application Unit test, It cannot create
.html or .xml file to show the result, just only the log.

                <macrodef name="run-tests-helper">

                               <attribute name="emma.enabled"
default="false" />

                               <element name="extra-instrument-args"
optional="yes" />


                                               <echo>Running tests

                                               <exec executable="${adb}"

value="shell" />

value="am" />

value="instrument" />

value="-w" />

value="-e" />

value="coverage" />

value="@{emma.enabled}" />

<extra-instrument-args />

value="${manifest.package}/${test.runner}" />





And I want to know whether building android application can same as jave
web or jave application building? Can create a .html or .xml file to
show the result?




Thank you

Best Regards


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message