forked from coldfumonkeh/cfml-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
103 lines (86 loc) · 3.75 KB
/
build.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
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="test" name="CFML CI">
<!--
The CFML CI template project.
For integration instructions, see the Github project page:
https://github.com/marcins/cfml-ci
-->
<!-- you should change this value to a short name for your project
will be used a symlink so shouldn't contain spaces -->
<property name="test.project" value="cfml-ci" />
<!-- these properties can either be passed in from your build server
(recommended), or set here if you're sure about that -->
<!-- the directory where the web server will be installed, WARNING
this directory WILL BE DELETED if it already exists -->
<property name="work.dir" value="" />
<!-- the directory containing your project web root, this will be symlinked
in to the webserver. Might be able to be left blank -->
<property name="build.dir" value="" />
<!-- the URL to download Railo Express from. TODO move the default URL from the CI
helper script to here -->
<property name="railo.url" value="" />
<!-- the URL to download MXUnit from. TODO move the default URL from the CI
helper script to here -->
<property name="mxunit.url" value="" />
<!--
***
Generally no need to touch anything below this point, but feel free to
customise it!
***
-->
<property name="mxunit.jar" value="tests/ci/mxunit-ant.jar"/>
<property name="mxunit.output.jar" value="tests/ci/mxunit-output-ant.jar"/>
<property name="server.name" value="localhost"/>
<property name="server.port" value="8888"/>
<property name="output.dir" value="tests/ci/results/"/>
<target name="install-ci-deps">
<exec executable="/bin/bash" failonerror="true">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<env key="RAILO_URL" value="${railo.url}" />
<env key="MXUNIT_URL" value="${mxunit.url}" />
<arg line="tests/ci/scripts/ci-helper.sh install ${test.project}"/>
</exec>
</target>
<target name="start-ci-railo">
<exec executable="/bin/bash" spawn="false" failonerror="true">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<arg line="tests/ci/scripts/ci-helper.sh start"/>
</exec>
</target>
<target name="stop-ci-railo">
<exec executable="/bin/bash" spawn="false">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<arg line="tests/ci/scripts/ci-helper.sh stop"/>
</exec>
</target>
<target name="test-ci-railo" depends="start-ci-railo,test,stop-ci-railo">
<fail if="mxunit.failed" message="At least one test failure!"/>
</target>
<target name="test" depends="test-run" />
<target description="Make output directories and run the MXUnit task" name="test-run">
<delete dir="${output.dir}"/>
<mkdir dir="${output.dir}"/>
<taskdef classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" name="mxunittask"/>
<taskdef classname="au.com.imagichine.ant.MxunitOutputAntTask" classpath="${mxunit.output.jar}" name="mxunitoutputtask"/>
<mxunittask
defaultrunner="/${test.project}/tests/ci/HttpAntRunner.cfc"
outputdir="${output.dir}"
port="${server.port}" server="${server.name}"
testResultsSummary="${test.project}.summary"
verbose="false"
haltonerror="true" errorproperty="mxunit.error"
failureproperty="mxunit.failed">
<directory
componentPath="tests"
packageName="${test.project}"
path="/${test.project}/tests/"
recurse="false"
remoteMethod="run"/>
</mxunittask>
<mxunitoutputtask resultsdirectory="${output.dir}" />
<fail if="mxunit.error" message="An error occured running MXUnit" />
</target>
</project>