blob: a81770548b3a1201ae8e38adb2978426b09cb6e8 [file] [log] [blame]
david_williamsce156292006-12-11 00:12:35 +00001<project
2 name="Build specific targets and properties"
3 default="test">
ndaib8cedc82005-09-13 18:00:32 +00004
david_williams42f9b242006-11-27 18:45:14 +00005 <!-- Note to be cross-platform, "environment variables" are only appropriate for
6 some variables, e.g. ones we set, since properties are case sensitive, even if
7 the environment variables on your operating system are not, e.g. it will
8 be ${env.Path} not ${env.PATH} on Windows -->
9 <property environment="env" />
ndaib8cedc82005-09-13 18:00:32 +000010
11
david_williamsc7ee45b2006-10-01 01:12:56 +000012 <!-- ===================================================================== -->
13 <!-- Steps to do after the build is done. -->
14 <!-- ===================================================================== -->
15 <target name="test">
16 <antcall target="runTest" />
17 </target>
ndaib8cedc82005-09-13 18:00:32 +000018
david_williamsc7ee45b2006-10-01 01:12:56 +000019 <!-- ===================================================================== -->
20 <!-- Steps to do to test the build results -->
21 <!-- ===================================================================== -->
22 <target name="runTest">
ndaib8cedc82005-09-13 18:00:32 +000023
david_williamsce156292006-12-11 00:12:35 +000024 <dirname
25 file="${ant.file}"
26 property="test.component.dir" />
david_williamsc7ee45b2006-10-01 01:12:56 +000027 <ant antfile="${wtp.builder.home}/scripts/build/label.xml" />
28 <property file="${buildDirectory}/label.properties" />
29 <property file="${wtp.builder.home}/build.properties" />
ndaib8cedc82005-09-13 18:00:32 +000030
david_williamsc7ee45b2006-10-01 01:12:56 +000031 <mkdir dir="${testRoot}" />
32 <mkdir dir="${testRoot}/results" />
33 <mkdir dir="${testRoot}/results/consolelogs" />
ndaib8cedc82005-09-13 18:00:32 +000034
david_williamsce156292006-12-11 00:12:35 +000035 <copy
36 todir="${testRoot}"
37 overwrite="true">
38 <fileset dir="${test.component.dir}/testScripts"></fileset>
david_williamsc7ee45b2006-10-01 01:12:56 +000039 </copy>
ndaib8cedc82005-09-13 18:00:32 +000040
david_williamsa8187bf2006-12-11 02:37:50 +000041 <echo message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} " />
david_williamsce156292006-12-11 00:12:35 +000042
43 <ant
44 antfile="${test.component.dir}/testdependency.xml"
45 target="get">
46 <property
47 name="dependency.properties"
48 value="${buildDirectory}/maps/releng/maps/dependencies.properties" />
49 <property
50 name="base.install.dir"
51 value="${testRoot}" />
david_williamsc7ee45b2006-10-01 01:12:56 +000052 </ant>
david_williamsce156292006-12-11 00:12:35 +000053
david_williams0c366d32006-12-10 07:08:39 +000054 <antcall target="unzipTests" />
david_williamsce156292006-12-11 00:12:35 +000055
david_williamsc7ee45b2006-10-01 01:12:56 +000056 <antcall target="runTestEclipse">
david_williamsce156292006-12-11 00:12:35 +000057 <param
58 name="testTarget"
59 value="all" />
david_williamsc7ee45b2006-10-01 01:12:56 +000060 </antcall>
61 <antcall target="postRunTestEclipse">
david_williamsce156292006-12-11 00:12:35 +000062 <param
63 name="testTarget"
64 value="all" />
david_williamsc7ee45b2006-10-01 01:12:56 +000065 </antcall>
david_williams5c2d92e2006-04-19 04:43:25 +000066
david_williamsc7ee45b2006-10-01 01:12:56 +000067 </target>
68
david_williamsce156292006-12-11 00:12:35 +000069 <target name="unzipTests">
david_williamsc7ee45b2006-10-01 01:12:56 +000070
david_williams43387212006-12-11 04:53:47 +000071 <!--unzip the builds and junit tests
72 we use 'unzip' here, so we can continue on error
73 (such as if zip was not created, due to other failures or options).
74 -->
david_williamsa8187bf2006-12-11 02:37:50 +000075 <exec
76 dir="${buildDirectory}/${buildLabel}"
77 executable="unzip"
78 failonerror="false">
79 <arg line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}" />
80 </exec>
david_williams59ab33d2006-12-10 03:47:50 +000081
david_williamsa8187bf2006-12-11 02:37:50 +000082 <exec
83 dir="${buildDirectory}/${buildLabel}"
84 executable="unzip"
85 failonerror="false">
86 <arg line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
87 </exec>
88 <exec
89 dir="${buildDirectory}/${buildLabel}"
90 executable="unzip"
91 failonerror="false">
92 <arg line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
93 </exec>
david_williamsce156292006-12-11 00:12:35 +000094
david_williamsa8187bf2006-12-11 02:37:50 +000095
96 <exec
97 dir="${buildDirectory}/${buildLabel}"
98 executable="unzip"
99 failonerror="false">
100 <arg line="-o -qq wtp-jsf-sdk-${buildLabel}.zip -d ${testRoot}" />
101 </exec>
102 <exec
103 dir="${buildDirectory}/${buildLabel}"
104 executable="unzip"
105 failonerror="false">
106 <arg line="-o -qq wtp-jsf-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
107 </exec>
108
109
110 <exec
111 dir="${buildDirectory}/${buildLabel}"
112 executable="unzip"
113 failonerror="false">
david_williamsef8c07a2006-12-15 01:37:08 +0000114 <arg line="-o -qq wtp-jpa-${buildLabel}.zip -d ${testRoot}" />
david_williamsa8187bf2006-12-11 02:37:50 +0000115 </exec>
116 <exec
117 dir="${buildDirectory}/${buildLabel}"
118 executable="unzip"
119 failonerror="false">
120 <arg line="-o -qq wtp-jpa-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
121 </exec>
david_williams0c366d32006-12-10 07:08:39 +0000122
david_williams59ab33d2006-12-10 03:47:50 +0000123 </target>
david_williamsc7ee45b2006-10-01 01:12:56 +0000124
david_williamsa8187bf2006-12-11 02:37:50 +0000125 <!-- time out may need to be set/adjust for api or performance tests?
126 some common values:
127 7200000: 2 hours
128 3600000: 1 hour
129 1800000: 30 minutes
130 -->
131 <property
132 name="testTimeLimit"
133 value="1800000" />
134 <property
135 name="testFailOnError"
136 value="false" />
137
david_williamsc7ee45b2006-10-01 01:12:56 +0000138 <target name="runTestEclipse">
david_williamsce156292006-12-11 00:12:35 +0000139 <java
140 taskname="test-wtp-${testTarget}"
141 classpath="${testRoot}/eclipse/startup.jar"
142 fork="true"
143 classname="org.eclipse.core.launcher.Main"
144 failonerror="${testFailOnError}"
145 timeout="${testTimeLimit}"
146 output="${testRoot}/results/consolelogs/wtptestlog.txt"
david_williamsc2f29802007-01-13 07:13:16 +0000147 dir="${testRoot}"
148 jvm="${env.JAVA_5_HOME}/bin/java">
david_williams42f9b242006-11-27 18:45:14 +0000149 <jvmarg value="-Dosgi.ws=${env.BASEWS}" />
150 <jvmarg value="-Dosgi.os=${env.BASEOS}" />
151 <jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
152 <jvmarg value="-Dws=${env.BASEWS}" />
153 <jvmarg value="-Dos=${env.BASEOS}" />
154 <jvmarg value="-Darch=${env.BASEARCH}" />
david_williams0c366d32006-12-10 07:08:39 +0000155 <jvmarg value="-Dosgi.clean=true" />
david_williamsc7ee45b2006-10-01 01:12:56 +0000156 <jvmarg value="-Dnoclean=true" />
ndai7383e5c2006-07-08 21:08:01 +0000157 <jvmarg value="-DbuildBranch=${buildBranch}" />
david_williamsc7ee45b2006-10-01 01:12:56 +0000158 <jvmarg value="-DbuildType=${buildType}" />
159 <jvmarg value="-DbuildId=${buildId}" />
david_williamsc7ee45b2006-10-01 01:12:56 +0000160 <arg value="-propertyfile" />
161 <arg value="test.properties" />
162 <arg value="-application" />
163 <arg value="org.eclipse.ant.core.antRunner" />
164 <arg value="-file" />
165 <arg value="test.xml" />
166 <arg value="-logger" />
167 <arg value="org.apache.tools.ant.DefaultLogger" />
168 <arg value="${testTarget}" />
david_williamsce156292006-12-11 00:12:35 +0000169 <sysproperty
170 key="build.home"
171 value="${build.home}" />
172 <sysproperty
173 key="buildDirectory"
174 value="${buildDirectory}" />
175 <sysproperty
176 key="baseLocation"
177 value="${baseLocation}" />
178 <sysproperty
179 key="testDir"
180 value="${testRoot}" />
181 <sysproperty
182 key="perf.buildId"
183 value="${buildType}${date}-${time}" />
184 <sysproperty
185 key="eclipseBuilderDirectory"
186 value="${pde.builder.path}" />
david_williamsc84ab8c2006-12-11 18:50:34 +0000187 <sysproperty
188 key="buildLabel"
189 value="${buildLabel}" />
190
david_williamsc7ee45b2006-10-01 01:12:56 +0000191 </java>
192 </target>
ndaib8cedc82005-09-13 18:00:32 +0000193
david_williamsc7ee45b2006-10-01 01:12:56 +0000194 <target name="postRunTestEclipse">
david_williamsce156292006-12-11 00:12:35 +0000195 <copy
196 todir="${buildDirectory}/${buildLabel}/testResults"
197 overwrite="true">
david_williamsc7ee45b2006-10-01 01:12:56 +0000198 <fileset dir="${testRoot}/results">
199 <include name="**/*.*" />
200 </fileset>
201 </copy>
202 </target>
ndaib8cedc82005-09-13 18:00:32 +0000203
ndaib8cedc82005-09-13 18:00:32 +0000204
205</project>