blob: 808d39f660cd15da5b10b16c4af688c3db4c6d57 [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
david_williams9ef9f652009-11-17 18:37:27 +000099 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_williams9ef9f652009-11-17 18:37:27 +0000126 <condition
127 property="dotlogavailable">
128 <available
129 file="${workspace}/.metadata/.log"/>
130 </condition>
david_williamsd51e2f12006-12-07 08:19:46 +0000131 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000132 <!--
133 This clean target holds code to cleanup the testing environment
134 after after all of the tests have been run. You can use this
135 target to delete temporary files that have been created, if
136 required. But, it's usually best to leave it all, in case you'd
137 like to inspect it after a failed run. It will be deleted
138 eventually by the next clean build.
139 -->
140 <target
141 name="cleanup">
david_williamsd51e2f12006-12-07 08:19:46 +0000142 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000143 <!--
144 This run target is the master target that get's all the work
145 done. Most activity is actually done in the 'depends' tasks, but
146 any actions that need to happen after all the tests have been
147 run should go here, such as copying the results to a common
148 'save' directory.
149 -->
150 <target
151 name="run"
david_williams9ef9f652009-11-17 18:37:27 +0000152 depends="init,suite,copylogs,copyxsl,cleanup">
153 <echo
154 message="unit test ran: ${ant.file}"/>
155 <echo
156 message="library-file: ${library-file}"/>
157 </target>
158 <target
159 name="copylogs"
160 if="dotlogavailable">
161 <copy
162 failonerror="false"
163 file="${workspace}/.metadata/.log"
164 tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt"/>
165 </target>
166 <target
167 name="copyxsl">
168 <!-- copy our particular xsl files to web directory for prosperity-->
169 <copy
170 todir="${buildDirectory}/${buildLabel}/"
171 flatten="true">
172 <fileset
173 dir="${eclipse-home}/plugins/">
174 <include
175 name="**/org.eclipse.wtp.releng.tests*/*.xsl"/>
176 </fileset>
177 </copy>
178 <!-- and use them to create basic display -->
179 <xslt
180 basedir="${buildDirectory}/${buildLabel}/"
181 includes="versioningReport_*"
182 destdir="${buildDirectory}/${buildLabel}/"
183 style="versioningReportToHTML.xsl"
184 force="true"/>
185 <echo
186 file="${buildDirectory}/${buildLabel}/versioningReportName.php">
187 <![CDATA[<?php $versionReportFilename="versioningReport_${buildLabel}" ?>]]>
188 </echo>
david_williamsd51e2f12006-12-07 08:19:46 +0000189 </target>
david_williamsd51e2f12006-12-07 08:19:46 +0000190</project>