blob: 0ab97c7cace1338bc936e34f16ca6041811da56b [file] [log] [blame]
david_williamsd51e2f12006-12-07 08:19:46 +00001<?xml version="1.0" encoding="UTF-8"?>
david_williamse24ea0d2009-11-16 13:59:54 +00002<project
3 name="testsuite"
4 default="run"
5 basedir=".">
6 <!--
7 ===================================================== There
8 should be no need to change what's above. (if there is, let us
9 know if the script can be improved.)
10 =====================================================
11 -->
12 <!--
13 Every suite needs to specify three thing: plugin-name, classname
14 - that provides the suite to test, and testType - either
15 core-test, or ui-test. There is an optional extraVMargs property
16 that some tests need to use in order to specify extra,
17 non-standard properties to the VM when it runs. If not need, no
18 need to specify it.
19 -->
20 <property
21 name="plugin-name"
22 value="org.eclipse.wtp.releng.tests"/>
23 <property
24 name="classname"
25 value="org.eclipse.wtp.releng.tests.TestBuild"/>
26 <property
27 name="testType"
28 value="core-test"/>
29 <!--
30 some test suites need to add special vm arguments when they run.
31 This is just an example. <property name="extraVMargs"
32 value="-DjsfRuntimeJarsDirectoryV1.1=${testDir}/${jsf1.1Dir}" />
33 <echo message="extraVMargs ${extraVMargs}" />
34 -->
35 <!--
36 ===================================================== There
37 should be no need to change what's below. (if there is, let us
38 know if the script can be improved.)
39 =====================================================
40 -->
41 <!--
42 There are some properties that must be provided by caller.
43 -->
44 <fail
45 message="Error: missing property. eclipse-home must be provided"
46 unless="eclipse-home"/>
47 <fail
48 message="Error: missing property. buildDirectory must be provided"
49 unless="buildDirectory"/>
50 <fail
51 message="Error: missing property. buildLabel must be provided"
52 unless="buildLabel"/>
53 <echo
54 message="basedir: ${basedir}"/>
55 <echo
56 message="eclipse-home: ${eclipse-home}"/>
57 <echo
58 message="buildDirectory: ${buildDirectory}"/>
59 <echo
60 message="buildLabel: ${buildLabel}"/>
61 <echo
62 message="plugin-name: ${plugin-name}"/>
63 <echo
64 message="classname: ${classname}"/>
65 <echo
66 message="testType ${testType}"/>
67 <echo
68 message="buildId ${buildId}"/>
69 <property
70 name="library-file"
71 value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
72 <property
73 name="workspace"
74 value="${eclipse-home}/junitworkspaces/${plugin-name}"/>
75 <!--
76 This init target holds all initialization code that needs to be
77 done for all tests that are to be run. Initialization for
78 individual tests should be done within the body of the suite
79 target. Here it's a good idea to delete things that might have
80 been created if the test has already been ran, just in case the
81 test is being re-ran.
82 -->
83 <target
84 name="init">
85 <tstamp/>
david_williamsd51e2f12006-12-07 08:19:46 +000086 <delete>
david_williamse24ea0d2009-11-16 13:59:54 +000087 <fileset
88 dir="${eclipse-home}"
89 includes="${plugin-name}.*xml"/>
david_williamsd51e2f12006-12-07 08:19:46 +000090 </delete>
david_williamse24ea0d2009-11-16 13:59:54 +000091 <!--
92 make the workspace directory, in case path doesn't exist yet
93 but delete to make sure fresh contents, if it does exist
94 -->
95 <delete
96 dir="${workspace}"
97 quiet="true"/>
98 <mkdir
99 dir="${workspace}"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000100 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000101 <!--
102 This suite target defines the tests that need to be run.
103 -->
104 <target
105 name="suite">
106 <ant
107 target="${testType}"
108 antfile="${library-file}"
109 dir="${eclipse-home}">
110 <property
111 name="data-dir"
112 value="${workspace}"/>
113 <property
114 name="plugin-name"
115 value="${plugin-name}"/>
116 <property
117 name="classname"
118 value="${classname}"/>
119 <property
120 name="vmargs"
121 value="-DbuildDirectory='${buildDirectory}' -DbuildLabel='${buildLabel}'"/>
122 <property
123 name="extraVMargs"
124 value="-DrelengTestsPropertiesFile=${keyCfgFile}"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000125 </ant>
david_williamse24ea0d2009-11-16 13:59:54 +0000126 <copy
127 failonerror="false"
128 file="${workspace}/.metadata/.log"
129 tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000130
david_williamse24ea0d2009-11-16 13:59:54 +0000131
132
david_williamsd51e2f12006-12-07 08:19:46 +0000133
david_williams55e16972008-08-08 04:25:53 +0000134 <!-- copy our particular xsl files to web directory for prosperity-->
david_williamse24ea0d2009-11-16 13:59:54 +0000135 <copy
136 todir="${buildDirectory}/${buildLabel}/"
137 flatten="true">
138 <fileset
139 dir="${eclipse-home}/plugins/">
140 <include
141 name="**/org.eclipse.wtp.releng.tests*/*.xsl"/>
142 </fileset>
david_williams3926e9f2006-12-09 08:23:14 +0000143 </copy>
david_williamse24ea0d2009-11-16 13:59:54 +0000144 <!-- and use them to create basic display -->
145 <xslt
146 basedir="${buildDirectory}/${buildLabel}/"
147 includes="versioningReport_*"
148 destdir="${buildDirectory}/${buildLabel}/"
149 style="versioningReportToHTML.xsl"
150 force="true"/>
151 <echo
152 file="${buildDirectory}/${buildLabel}/versioningReportName.php">
david_williamsd051b362009-01-20 01:31:43 +0000153 <![CDATA[<?php $versionReportFilename="versioningReport_${buildLabel}" ?>]]>
david_williamsbb1d93b2006-12-10 05:21:55 +0000154 </echo>
david_williamsd51e2f12006-12-07 08:19:46 +0000155 </target>
156
david_williamse24ea0d2009-11-16 13:59:54 +0000157 <!--
158 This clean target holds code to cleanup the testing environment
159 after after all of the tests have been run. You can use this
160 target to delete temporary files that have been created, if
161 required. But, it's usually best to leave it all, in case you'd
162 like to inspect it after a failed run. It will be deleted
163 eventually by the next clean build.
164 -->
165 <target
166 name="cleanup">
david_williamsd51e2f12006-12-07 08:19:46 +0000167 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000168 <!--
169 This run target is the master target that get's all the work
170 done. Most activity is actually done in the 'depends' tasks, but
171 any actions that need to happen after all the tests have been
172 run should go here, such as copying the results to a common
173 'save' directory.
174 -->
175 <target
176 name="run"
177 depends="init,suite,cleanup">
178 <ant
179 target="collect"
180 antfile="${library-file}"
181 dir="${eclipse-home}">
182 <property
183 name="includes"
184 value="${plugin-name}.*xml"/>
185 <property
186 name="output-file"
187 value="${plugin-name}.xml"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000188 </ant>
david_williamsd51e2f12006-12-07 08:19:46 +0000189 </target>
david_williamsd51e2f12006-12-07 08:19:46 +0000190</project>