I am very new to ANT script. I am working on an android application and I have created the corresponding Junit android test application. Now I have the following in my build.xml file of my test project
<property name="src.dir" location="src" />
<property name="test.dir" location="tests" />
<property name="build.dir" location="bin" />
<property name="build.test.dir" location="bin/tests" />
<property name="test.report.dir" location="testreport" />
<path id="junit.class.path">
<pathelement location="libs/junit.jar" />
<pathelement location="lib/hamcrest-core-1.3.jar" />
<pathelement location="${build.dir}" />
</path>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${test.report.dir}" />
</target>
<target name="makedir">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.test.dir}" />
<mkdir dir="${test.report.dir}" />
</target>
<target name="compile" depends="clean, makedir">
<echo>compile:clean, makedir</echo>
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="junit.class.path" />
</javac>
<javac srcdir="${test.dir}" destdir="${build.test.dir}">
<classpath refid="junit.class.path" />
</javac>
</target>
<target name="junit" depends="compile">
<echo>junit: compile</echo>
<junit printsummary="on" fork="true" haltonfailure="yes">
<classpath refid="junit.class.path" />
<classpath>
<pathelement location="${build.test.dir}"/>
</classpath>
<formatter type="xml" />
<batchtest todir="${test.report.dir}">
<fileset dir="${test.dir}">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="main" depends="compile, junit">
<description>Main target</description>
</target>
When I run the above code right click on build.xml->run as ant, I can execute Junit test scripts, but the test case results are alwasys errors or crashes. I probably need to run these test scripts on the device. How can I run these test scripts on the device, and at the same time I need to also get a code coverage report. Please help me with this.