Ant和Junit:没有生成xml报告 [英] Ant and Junit: no xml report being generated
本文介绍了Ant和Junit:没有生成xml报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对ant和junit很陌生.我需要junit创建xml输出,以便可以与Team City集成.测试运行得很好,但是我在指定的目录中没有得到任何输出.我在Windows 7上运行.我的ant_home/lib目录中有junit.jar和ant-junit.jar.这是我的构建xml目标:
I'm very new to ant and junit. I need junit to create an xml output so I can integrate with team city. The tests run just fine, but I'm not getting any output in the directory that I'm specifying. I'm running on windows 7. I have junit.jar and ant-junit.jar in my ant_home/lib directory. here is my build xml target:
<target name="onlyjunit-sikuli" description="Execute All sikuli tests">
<delete dir="${automated}/results/sikuli"/>
<mkdir dir="${automated}/results"/>
<mkdir dir="${automated}/results/sikuli"/>
<junit printsummary="yes" showoutput="yes" fork="true" forkmode="once">
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Xms512m"/>
<jvmarg value="-Dsikuli.mode=${sikuli.mode}"/>
<classpath refid="classpath.test"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<batchtest if="env.testname" todir="${automated}/results/sikuli">
<fileset dir="${automated}/src">
<include name="**/com/foo/builder/Sikuli/**/${env.testname}.java"/>
</fileset>
</batchtest>
<test unless="env.testname" name="com.foo.builder.Sikuli.SikuliTestSuite"/>
</junit>
<junitreport todir="${automated}/results/sikuli/report">
<fileset dir="${automated}/results/sikuli" includes="*.xml"/>
<report todir="${automated}/results/sikuli/report"/>
</junitreport>
</target>
我在做什么错了?
推荐答案
我必须在测试元素上添加todir.
I had to add a todir on the test element.
这篇关于Ant和Junit:没有生成xml报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文