|
Buildfile: D:\test\test1\build.xml
compile:
BUILD FAILED
D:\test\test1\build.xml:27: destination directory "D:\test\test1\${build}" does not exist or is not a directory
下面是BUILD.XML的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!-- =============================================
auto unittest task
ai92
========================================== -->
<project name="auto unittest task" default="junit and report" basedir=".">
<property name="output folder" value="bin"/>
<property name="src folder" value="src"/>
<property name="test folder" value="src"/>
<property name="report folder" value="report" />
<!-- - - - - - - - - - - - - - - - - -
target: test report folder init
- - - - - - - - - - - - - - - - - -->
<target name="test init">
<mkdir dir="${report}"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile
- - - - - - - - - - - - - - - - - -->
<target name="compile">
<javac srcdir="${src.dir}" destdir="${build}" />
<echo>compilation complete!</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile test cases
- - - - - - - - - - - - - - - - - -->
<target name="test compile" depends="test init">
<javac srcdir="${src.dir}" destdir="${bulid}" />
<echo>test compilation complete!</echo>
</target>
<target name="all compile" depends="compile, test compile">
</target>
<!-- ========================================
target: auto test all test case and output report file
===================================== -->
<target name="junit and report" depends="all compile">
<junit printsummary="yes" fork="yes" showoutput="true">
<classpath>
<fileset dir="src" includes="**/*.jar"/>
<pathelement path="${build}"/>
</classpath>
<formatter type="xml" />
<batchtest todir="${src}">
<fileset dir="${bulid}">
<include name="**/Test*.*" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${report}">
<fileset dir="${report}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${report}" />
</junitreport>
<fail message="testfaild" if="test.failed"/>
</target>
</project> |
|