android:junit 报告生成
我想在 android 中运行 junit 测试用例后生成 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 报告, 请在这方面帮助我, 糖果达米。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
include 标记是问题所在:
include 的名称:
com.android.test.PatientContentManagerTestCase.java
必须与您自己的测试类的名称相对应。The include tag is the problem:
The name of the include :
com.android.test.PatientContentManagerTestCase.java
must correspond with the name of your own test class.最新的 Maven Android 插件将为您做到这一点。在此处查看更多信息
http://www .simpligility.com/2011/09/easier-android-test-reporting-with-maven-and-hudson/
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/