Android: генерация отчетов Junit - PullRequest
0 голосов
/ 28 февраля 2011

Я хочу создать отчет 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 ]

2 голосов
/ 10 ноября 2012

Проблема с тегом include:

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

Имя включаемого: com.android.test.PatientContentManagerTestCase.java должно соответствовать названию вашего собственного класса тестирования.

0 голосов
/ 02 сентября 2011

Последний плагин Maven для Android сделает это за вас.Подробнее здесь

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

...