Ant and Junit: no xml report being generated

青春壹個敷衍的年華 提交于 2019-12-10 11:04:56

问题


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>

What am I doing wrong?


回答1:


I had to add a todir on the test element.



来源:https://stackoverflow.com/questions/5994790/ant-and-junit-no-xml-report-being-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!