Android: генерация отчетов Junit
Я хочу сгенерировать отчет HTml после запуска тестового примера junit в android.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.
2 ответа
Тег включения является проблемой:
<include name="com.android.test.PatientContentManagerTestCase.java" />
Название включает в себя: com.android.test.PatientContentManagerTestCase.java
должен соответствовать названию вашего собственного тестового класса.
Последний плагин Maven Android сделает это за вас. Подробнее здесь
http://www.simpligility.com/2011/09/easier-android-test-reporting-with-maven-and-hudson/