-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathruntests.ent
93 lines (80 loc) · 3.9 KB
/
runtests.ent
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
<project name="runtests" default="test" basedir=".">
<import file="build.xml"/>
<property name="firebug.dir" location="${basedir}/"/>
<property name="test.dir" value="${basedir}/test"/>
<property name="test.profile.dir" location="${test.dir}/testprofile/"/>
<target name="test" depends="xpi">
<property name="test.port" value="65432"/>
<property name="test.profile.name" value="crossfire-test-${build.time}"/>
<property name="test.timeout" value="30000"/> <!-- ten second timeout -->
<echo>Creating test profile in ${test.profile.dir}</echo>
<mkdir dir="${test.profile.dir}"/>
<exec executable="firefox" failonerror="true">
<arg value="-no-remote"/>
<arg value="-CreateProfile"/>
<arg value="${test.profile.name} ${test.profile.dir}"/>
</exec>
<!-- link extensions -->
<mkdir dir="${test.profile.dir}/extensions/"/>
<echo> Installing Firebug at ${firebug.dir} </echo>
<echo file="${test.profile.dir}/extensions/[email protected]">${firebug.dir}</echo>
<echo> Installing Crossfire at ${build.dir} </echo>
<echo file="${test.profile.dir}/extensions/[email protected]">${build.dir}</echo>
<echo file="${test.profile.dir}/prefs.js" append="true">
user_pref("extensions.firebug.allPagesActivation", "on");
user_pref("extensions.firebug.script.enableSites", true);
user_pref("extensions.firebug.console.enableSites", true);
</echo>
<parallel threadCount="2" >
<sequential>
<!-- launch firefox in server mode with test profile -->
<echo> Launching Firefox and Crossfire server on port ${test.port} </echo>
<exec executable="firefox" timeout="${test.timeout}">
<arg value="-no-remote"/>
<arg value="-P"/>
<arg value="${test.profile.name}"/>
<arg value="-crossfire-server-port"/>
<arg value="${test.port}"/>
</exec>
</sequential>
<sequential>
<waitfor maxwait="${test.timeout}" maxwaitunit="millisecond">
<socket server="localhost" port="${test.port}"/>
</waitfor>
<!-- run test client script -->
<echo> Starting test client...</echo>
<exec osfamily="windows" executable="python" timeout="${test.timeout}" failonerror="true">
<arg value="${test.dir}/crossfire_test_client.py"/>
<arg value="--host"/>
<arg value="localhost"/>
<arg value="--port"/>
<arg value="${test.port}"/>
<arg value="--command"/>
<arg value="createcontext"/>
<arg value="--args"/>
<arg value='{ \"url\": \"http://www.getfirebug.com\" }'/>
</exec>
<exec osfamily="unix" executable="python" timeout="${test.timeout}" failonerror="true">
<arg value="${test.dir}/crossfire_test_client.py"/>
<arg value="--host"/>
<arg value="localhost"/>
<arg value="--port"/>
<arg value="${test.port}"/>
<arg value="--command"/>
<arg value="createcontext"/>
<arg value="--args"/>
<arg value='{ "url": "http://www.getfirebug.com" }'/>
</exec>
</sequential>
</parallel>
</target>
<target name="firefox">
<ant dir="${basedir}/firefox"/>
</target>
<target name="detrace">
<echo>Nothing happened.</echo>
</target>
<target name="clean">
<delete includeemptydirs="true" failonerror="false" dir="${test.profile.dir}"/>
</target>
</project>