如何自动生成新的单元测试蚂蚁报告
how to auto generate new unit test ant reports
我正在使用 ant junit 为我的单元测试生成报告,假设我有一个名为 userServiceTest
的单元测试,所以在 my build.xml
文件中我输入了以下内容:
<target name="UserServiceTest">
<mkdir dir="${junit.output.dir}" />
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml" />
<test name="webapp.service.UserServiceTest" todir="${junit.output.dir}" />
<jvmarg line="-ea" />
<classpath refid="Web Application.classpath" />
</junit>
</target>
现在假设我添加了一个名为 productServiceTest
的新单元测试 class 是否可以将这个自动生成的新单元测试包含在我的报告中?
提前致谢。
尝试 <batchtest>
而不是 <test>
:
<target name="UserServiceTest">
<mkdir dir="${junit.output.dir}" />
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml" />
<batchtest fork="yes" todir="${junit.output.dir}">
<fileset dir="${src.tests}">
<include name="webapp.service.*ServiceTest"/>
</fileset>
</batchtest>
<jvmarg line="-ea" />
<classpath refid="Web Application.classpath" />
</junit>
</target>
我正在使用 ant junit 为我的单元测试生成报告,假设我有一个名为 userServiceTest
的单元测试,所以在 my build.xml
文件中我输入了以下内容:
<target name="UserServiceTest">
<mkdir dir="${junit.output.dir}" />
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml" />
<test name="webapp.service.UserServiceTest" todir="${junit.output.dir}" />
<jvmarg line="-ea" />
<classpath refid="Web Application.classpath" />
</junit>
</target>
现在假设我添加了一个名为 productServiceTest
的新单元测试 class 是否可以将这个自动生成的新单元测试包含在我的报告中?
提前致谢。
尝试 <batchtest>
而不是 <test>
:
<target name="UserServiceTest">
<mkdir dir="${junit.output.dir}" />
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml" />
<batchtest fork="yes" todir="${junit.output.dir}">
<fileset dir="${src.tests}">
<include name="webapp.service.*ServiceTest"/>
</fileset>
</batchtest>
<jvmarg line="-ea" />
<classpath refid="Web Application.classpath" />
</junit>
</target>