|
这个是我的代码
<?xml version="1.0" encoding="UTF-8"?>
<project name = "Testcase" default = "init">
<!-- 指定JUnit类库的位置 -->
<property name = "junitJar" value = "lib/junit.jar"/>
<target name = "init">
<mkdir dir = "report"/>
<mkdir dir = "htmlreport"/>
</target>
<!-- //编译源文件 -->
<target name = "compile">
<javac destdir = "src" srcdir = "src" includeantruntime="on">
<classpath>
<pathelement location = "${junitJar}"/>
</classpath>
</javac>
</target>
<!-- //执行JUnit测试 -->
<target name = "run" depends = "compile">
<echo message = "start run Junit test"/>
<junit>
<classpath>
<pathelement location = "src"/>
<pathelement location = "${junitJar}"/>
</classpath>
<romatter type = "xml"/>
<batchtest haltonfailure = "no" todir = "report">
<fileset dir = "src">
<include name = "**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<!--//生成html报表 -->
<junitReport todir = "./htmlreport">
<fileset dir = "./report">
<include name = "TEST-*.xml"/>
</fileset>
<report format = "noframes" todir = "./htmlreport"/>
</junitReport>
<echo message = "end running junit test"/>
</target>
</project>
执行后,显示如下结果
Buildfile: C:\Documents and Settings\ccxopen\workspace\Anttest\build.xml
init:
BUILD SUCCESSFUL
Total time: 67 milliseconds
也就是只执行了init 这个target,complie和run都没有执行,为什么呢,谁能跟我说一下吗 |
|