首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android:junit报告生成

android:junit报告生成
EN

Stack Overflow用户
提问于 2011-02-28 17:07:36
回答 2查看 1.2K关注 0票数 0

我想在android.Testcase中运行AndroidTestCase、ProviderTestCase和ServiceTestCase类型的junit测试用例后生成HTml报告。而junit的报告任务是:

代码语言:javascript
复制
<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。

EN

回答 2

Stack Overflow用户

发布于 2012-11-10 14:01:15

include标签就是问题所在:

代码语言:javascript
复制
<include name="com.android.test.PatientContentManagerTestCase.java" />

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

票数 2
EN

Stack Overflow用户

发布于 2011-09-02 15:13:06

最新的Maven Android插件将为您做到这一点。点击此处查看更多信息

http://www.simpligility.com/2011/09/easier-android-test-reporting-with-maven-and-hudson/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5139958

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档