File: build.xml

package info (click to toggle)
libtest-www-selenium-perl 1.36-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 436 kB
  • ctags: 189
  • sloc: perl: 2,382; xml: 1,459; makefile: 8
file content (144 lines) | stat: -rw-r--r-- 5,418 bytes parent folder | download | duplicates (4)
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
142
143
144
<project name="selenium" default="generate-sources">
    <target name="init">
		<property environment="env" />
		<property name="env.PERL5LIB" value="" />
		<property name="perl.executable" value="perl" />
		<presetdef name="perl">
			<exec executable="${perl.executable}" failonerror="true">
				<env key="PERL5LIB" value="${env.PERL5LIB}" />
			</exec>
		</presetdef>
		<!-- Cygwin make won't work with the auto-generated Makefile -->
		<condition property="make.executable" value="nmake">
			<os family="windows" />
		</condition>
		<property name="make.executable" value="make" />
		<presetdef name="make">
			<exec executable="${make.executable}" failonerror="true">
				<env key="PERL5LIB" value="${env.PERL5LIB}" />
			</exec>
		</presetdef>
		<!-- <perl>
			<arg value="-e" />
			<arg value="print qq(@INC);" />
		</perl>-->
	</target>
	<target name="generate-sources" depends="init">
    	<perl>
    	    <arg value="util/create_www_selenium.pl" />
    	</perl>
    </target>
    <target name="doc" depends="init, generate-sources">
    	<mkdir dir="doc"/>
    	<property name="outfile.www.selenium" location="doc/WWW-Selenium.html" />
    	<perl>
			<arg value="mypod2html.pl"/>
			<arg value="--infile=lib/WWW/Selenium.pm" />
			<arg value="--outfile=${outfile.www.selenium}" />
		</perl>
		<property name="outfile.test.www.selenium" location="doc/Test-WWW-Selenium.html" />
    	<perl>
			<arg value="mypod2html.pl"/>
			<arg value="--infile=lib/Test/WWW/Selenium.pm" />
			<arg value="--outfile=${outfile.test.www.selenium}" />
		</perl>
		<echo file="doc/index.html"><![CDATA[
<html><head><title>Selenium RC PerlDoc</title></head>
<body>
<h1>Selenium RC PerlDoc</h1>
<p><a href="WWW-Selenium.html">WWW::Selenium</a></p>
<p><a href="Test-WWW-Selenium.html">Test::WWW::Selenium</a></p>
</body></html>
]]>
</echo>
    </target>
    <target name="all" depends="generate-sources, test, doc"/>
    <target name="make" depends="init, generate-sources">
    	<perl>
    		<arg value="Makefile.PL" />
    	</perl>
    	<make />
    </target>
    
    <target name="pre-test">
        <condition property="skiptests-headless">
            <or>
                <isset property="skiptests" />
                <not><istrue value="${headless}" /></not>
            </or>
        </condition>
        <condition property="skiptests-nonheadless">
            <or>
                <istrue value="${headless}" />
                <isset property="skiptests" />
            </or>
        </condition>
    </target>
    
    <target name="test-nonheadless" depends="init, make, pre-test" unless="skiptests-nonheadless">
    	<echo>${selenium-server}</echo>
        <java jar="${selenium-server}" fork="true" spawn="true"/>
        <sleep seconds="20"/>
        <make failonerror="false" resultproperty="result">
        	<arg value="test" />
        </make>
        <get taskname="selenium-shutdown" src="http://localhost:4444/selenium-server/driver/?cmd=shutDown" dest="target/shutdown-result.txt" ignoreerrors="true" />
        <sleep seconds="20"/>
        <condition property="build.failed">
        	<not><equals arg1="0" arg2="${result}" /></not>
        </condition>
        <fail if="build.failed" message="perl tests failed!" />
    </target>
    
    <target name="test-headless" depends="init, make, pre-test" unless="skiptests-headless">
    	<echo>${selenium-server}</echo>
        <java jar="${selenium-server}" fork="true" spawn="true"/>
        <sleep seconds="20"/>
        <property name="lib.dir" location="lib" />
        <perl failonerror="false" resultproperty="result">
            <arg value="-MExtUtils::Command::MM" />
            <arg value="-e" />
            <arg value="test_harness(0, 'inc', 'blib/lib', 'blib/arch')" />
            <arg file="t/test_i18n.t" />
        </perl>
        <get taskname="selenium-shutdown" src="http://localhost:4444/selenium-server/driver/?cmd=shutDown" dest="target/shutdown-result.txt" ignoreerrors="true" />
        <sleep seconds="20"/>
        <condition property="build.failed">
        	<not><equals arg1="0" arg2="${result}" /></not>
        </condition>
        <fail if="build.failed" message="perl tests failed!" />
    </target>
    
    <target name="test" depends="test-headless, test-nonheadless" />
    
    <target name="dist" depends="generate-sources, doc">
        <mkdir dir="target" />
        <property name="project.version" value="UNKNOWNVERSION" />
        <property name="perl.release" value="selenium-perl-client-driver-${project.version}"/>
        <zip zipfile="target/${perl.release}.zip">
            <zipfileset dir="." prefix="${perl.release}">
                <include name="Makefile.PL"/>
                <include name="Changes"/>
                <include name="todo.txt"/>
                <include name="inc/**"/>
                <include name="lib/**"/>
                <include name="t/**"/>
                <exclude name="mypod2html.pl" />
                <include name="doc/**" />
            </zipfileset>
        </zip>
        <zip zipfile="target/${perl.release}-doc.zip">
            <zipfileset dir="doc" prefix="perl" />
        </zip>
    </target>
    
    <target name="clean">
    	<delete file="lib/WWW/Selenium.pm" />    	
    	<mkdir dir="doc" />
    	<delete dir="doc" />
    	<mkdir dir="blib" />
    	<delete dir="blib" />
    	<mkdir dir="target" />
    	<delete dir="target" />
    </target>
</project>