android:junit报告生成

android:junit报告生成,android,servicetestcase,Android,Servicetestcase,我想在android中运行junit testcase后生成HTml报告。testcase的类型为AndroidTestCase、ProviderTestCase和ServiceTestCase。 这方面的junit报告任务是:- <project name="junitreport-problem" default="test" basedir="."> <target name="test"> <path id="jarfilepath" > <fi

我想在android中运行junit testcase后生成HTml报告。testcase的类型为AndroidTestCase、ProviderTestCase和ServiceTestCase。 这方面的junit报告任务是:-

<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>

此任务正在生成空白html报告, 请在这方面帮助我,
candyDhami。

最新的Maven Android插件将为您实现这一点。在这里看到更多


包含标签是问题所在:

<include name="com.android.test.PatientContentManagerTestCase.java" />


include的名称:
com.android.test.PatientContentManagerTestCase.java
必须与您自己的测试类名称对应。

我看不出他的include有任何区别:。所以你的答案不正确。我的意思是,名为com.android.test.PatientContentManagerTestCase.java的值是错误的,它必须与他的测试类相对应。哦,我明白了,也许你应该编辑你的帖子并添加此信息!这将使它更有价值:)如果您还没有,也可以查看我们的常见问题解答如果您添加信息,我将投票支持您的答案。;)