-
Notifications
You must be signed in to change notification settings - Fork 146
/
flexunit-tests.xml
141 lines (102 loc) · 4.13 KB
/
flexunit-tests.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="flexunit-tests" default="test">
<property name="FLEX_HOME" location="${basedir}"/>
<property name="FLEXUNIT_HOME" value="${FLEX_HOME}/../flex-flexunit"/>
<property name="exit" value="false"/>
<target name="test" depends="test-check, test-run, test-clean"
description="Runs FlexUnit tests"/>
<target name="test-check">
<available
type="dir" file="${FLEXUNIT_HOME}"
property="FLEXUNIT_HOME.set" />
<fail message="The FLEXUNIT_HOME variable is not set to a directory"
unless="FLEXUNIT_HOME.set"/>
<echo message="FLEXUNIT_HOME is set: ${FLEXUNIT_HOME}"/>
<available
type="dir" file="${project.root}"
property="project.root.set" />
<fail message="The 'project.root' variable is not set to a directory"
unless="project.root.set"/>
<echo message="'project.root' is set: ${project.root}"/>
</target>
<target name="-test-run-prepare">
<property name="tests.bin" location="${basedir}/bin-tests"/>
<condition property="project.needs.extra.libs">
<isset property="project.libs"/>
</condition>
<taskdef resource="flexUnitTasks.tasks">
<classpath>
<fileset dir="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target">
<include name="flexUnitTasks*.jar"/>
</fileset>
</classpath>
</taskdef>
<echo message="Unit tests for '${project.root}'"/>
<mkdir dir="${tests.bin}"/>
</target>
<target name="-test-run-execute" unless="project.needs.extra.libs">
<flexunit
workingDir="${tests.bin}"
toDir="${tests.bin}/report"
haltonfailure="false"
verbose="true"
debug="true"
localTrusted="true">
<source dir="${project.root}/src"/>
<testSource dir="${project.root}/tests">
<include name="**/*Tests.as"/>
</testSource>
<library file="${FLEXUNIT_HOME}/FlexUnit4/target/flexunit-4.3.0-20140410-flex_4.12.0.swc"/>
<library dir="${FLEXUNIT_HOME}/FlexUnit4CIListener/target"/>
</flexunit>
</target>
<target name="-test-run-execute-with-extra-lib" if="project.needs.extra.libs">
<flexunit
workingDir="${tests.bin}"
toDir="${tests.bin}/report"
haltonfailure="false"
verbose="true"
debug="true"
localTrusted="true">
<source dir="${project.root}/src"/>
<testSource dir="${project.root}/tests">
<include name="**/*Tests.as"/>
</testSource>
<library file="${FLEXUNIT_HOME}/FlexUnit4/target/flexunit-4.3.0-20140410-flex_4.12.0.swc"/>
<library dir="${FLEXUNIT_HOME}/FlexUnit4CIListener/target"/>
<library dir="${project.libs}"/>
</flexunit>
</target>
<target name="-test-run-report">
<mkdir dir="${FLEX_HOME}/test-reports"/>
<copy todir="${FLEX_HOME}/test-reports">
<fileset dir="${project.root}">
<include name="TEST-*.xml" />
</fileset>
</copy>
</target>
<target name="test-run" depends="-test-run-prepare, -test-run-execute, -test-run-execute-with-extra-lib, -test-run-report" unless="${exit}"/>
<target name="test-clean" unless="${exit}">
<echo message="Clean up test artefacts"/>
<delete dir="${tests.bin}"/>
<delete>
<fileset dir="${project.root}">
<include name="TEST-*.xml" />
</fileset>
</delete>
</target>
</project>