我想在android.Testcase中运行AndroidTestCase、ProviderTestCase和ServiceTestCase类型的junit测试用例后生成HTml报告。而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。
发布于 2012-11-10 14:01:15
include标签就是问题所在:
<include name="com.android.test.PatientContentManagerTestCase.java" />com.android.test.PatientContentManagerTestCase.java的名称必须与您自己的测试类的名称相对应。
发布于 2011-09-02 15:13:06
最新的Maven Android插件将为您做到这一点。点击此处查看更多信息
http://www.simpligility.com/2011/09/easier-android-test-reporting-with-maven-and-hudson/
https://stackoverflow.com/questions/5139958
复制相似问题