Reputation: 51
i want to generate the HTml Report after running the junit testcase in android.Testcase are of type AndroidTestCase ,ProviderTestCase and ServiceTestCase. and junit report task for this is :-
<project name="junitreport-problem" default="test" basedir=".">
<target name="test">
<path id="jarfilepath" >
<fileset dir="lib" >
<include name="*.jar" />
</fileset>
</path>
<junit printsummary="true" >
<classpath refid="jarfilepath" />
<classpath location="./bin" />
<!--type is xml, plain or brief. Best practice is xml-->
<!-- usefile attribute determines whether output should be sent
to a file -->
<formatter type="xml" usefile="true" />
<!-- we can use batchtest instead of test task in ant -->
<!-- <test todir="report" name ="com.android.test.PatientContentManagerTestCase" /> -->
<batchtest todir="report">
<fileset dir="src">
<include name="com.android.test.PatientContentManagerTestCase.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="report">
<fileset dir="report">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="report/html"/>
</junitreport>
</target>
</project>
This task is generating blank html Report, please kindly help me in this regard, candyDhami.
Upvotes: 0
Views: 1280
Reputation: 21
The include tag is the problem:
<include name="com.android.test.PatientContentManagerTestCase.java" />
The name of the include : com.android.test.PatientContentManagerTestCase.java
must correspond with the name of your own test class.
Upvotes: 2
Reputation: 29912
The latest Maven Android Plugin will do that for you. See more here
http://www.simpligility.com/2011/09/easier-android-test-reporting-with-maven-and-hudson/
Upvotes: 0