-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.xml
62 lines (49 loc) · 1.71 KB
/
test.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0"?>
<project name="Rectangle-Test" default="main" basedir=".">
<property environment="env"/>
<!-- Sets variables which can later be used. -->
<!-- The value of the property is accessed via $(...} -->
<!-- where ... is replaced by the property name -->
<property name="src.dir" location="src" />
<property name="build.dir" location="bin" />
<property name="dist.dir" location="dist" />
<property name="report.dir" location="reports" />
<path id="class.path">
<pathelement location="./lib/junit.jar" />
<pathelement location="./lib/junit4.jar" />
<pathelement location="${build.dir}"/>
</path>
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath refid="class.path"/>
</taskdef>
<!-- delete existing build artefacts -->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${report.dir}" />
</target>
<!-- create new build artefact directories -->
<target name="makedir" depends="clean">
<mkdir dir="${build.dir}" />
<mkdir dir="${report.dir}" />
</target>
<!-- compile -->
<target name="compile" depends="makedir">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="class.path" />
</javac>
</target>
<!-- Create reference to test class to execute -->
<target name="test" depends="compile">
<junit printsummary="yes" fork="true">
<classpath refid="class.path"/>
<test name="RectangleTest" todir="${report.dir}" outfile="result">
<formatter type="xml"/>
</test>
</junit>
</target>
<!-- entry point to make executable -->
<target name="main" depends="test">
<description>Main target</description>
</target>
</project>