blob: f2081bec7ca1be60daa3334a68a06a869c940f44 [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 <!--
david_williamse8b7dee2009-11-26 19:05:59 +000036 There should be no need to change what's below. (if there is, let us
david_williamse24ea0d2009-11-16 13:59:54 +000037 know if the script can be improved.)
david_williamse24ea0d2009-11-16 13:59:54 +000038 -->
39 <!--
40 There are some properties that must be provided by caller.
41 -->
42 <fail
43 message="Error: missing property. eclipse-home must be provided"
44 unless="eclipse-home"/>
45 <fail
46 message="Error: missing property. buildDirectory must be provided"
47 unless="buildDirectory"/>
48 <fail
49 message="Error: missing property. buildLabel must be provided"
50 unless="buildLabel"/>
david_williamse8b7dee2009-11-26 19:05:59 +000051 <fail
52 message="Error: missing property. library-file must be provided"
53 unless="library-file"/>
54
55
david_williamse24ea0d2009-11-16 13:59:54 +000056 <echo
57 message="basedir: ${basedir}"/>
58 <echo
59 message="eclipse-home: ${eclipse-home}"/>
60 <echo
61 message="buildDirectory: ${buildDirectory}"/>
62 <echo
63 message="buildLabel: ${buildLabel}"/>
64 <echo
65 message="plugin-name: ${plugin-name}"/>
66 <echo
67 message="classname: ${classname}"/>
68 <echo
69 message="testType ${testType}"/>
70 <echo
71 message="buildId ${buildId}"/>
david_williamse8b7dee2009-11-26 19:05:59 +000072
david_williamse24ea0d2009-11-16 13:59:54 +000073 <property
74 name="workspace"
75 value="${eclipse-home}/junitworkspaces/${plugin-name}"/>
76 <!--
77 This init target holds all initialization code that needs to be
78 done for all tests that are to be run. Initialization for
79 individual tests should be done within the body of the suite
80 target. Here it's a good idea to delete things that might have
81 been created if the test has already been ran, just in case the
82 test is being re-ran.
83 -->
84 <target
85 name="init">
86 <tstamp/>
david_williamsd51e2f12006-12-07 08:19:46 +000087 <delete>
david_williamse24ea0d2009-11-16 13:59:54 +000088 <fileset
89 dir="${eclipse-home}"
90 includes="${plugin-name}.*xml"/>
david_williamsd51e2f12006-12-07 08:19:46 +000091 </delete>
david_williamse24ea0d2009-11-16 13:59:54 +000092 <!--
93 make the workspace directory, in case path doesn't exist yet
94 but delete to make sure fresh contents, if it does exist
95 -->
96 <delete
97 dir="${workspace}"
98 quiet="true"/>
99 <mkdir
david_williams9ef9f652009-11-17 18:37:27 +0000100 dir="${workspace}"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000101 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000102 <!--
103 This suite target defines the tests that need to be run.
104 -->
105 <target
106 name="suite">
107 <ant
108 target="${testType}"
109 antfile="${library-file}"
110 dir="${eclipse-home}">
111 <property
112 name="data-dir"
113 value="${workspace}"/>
114 <property
115 name="plugin-name"
116 value="${plugin-name}"/>
117 <property
118 name="classname"
119 value="${classname}"/>
120 <property
david_williamse24ea0d2009-11-16 13:59:54 +0000121 name="extraVMargs"
122 value="-DrelengTestsPropertiesFile=${keyCfgFile}"/>
david_williamsd51e2f12006-12-07 08:19:46 +0000123 </ant>
david_williams9ef9f652009-11-17 18:37:27 +0000124 <condition
125 property="dotlogavailable">
126 <available
127 file="${workspace}/.metadata/.log"/>
128 </condition>
david_williamsd51e2f12006-12-07 08:19:46 +0000129 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000130 <!--
131 This clean target holds code to cleanup the testing environment
132 after after all of the tests have been run. You can use this
133 target to delete temporary files that have been created, if
134 required. But, it's usually best to leave it all, in case you'd
135 like to inspect it after a failed run. It will be deleted
136 eventually by the next clean build.
137 -->
138 <target
139 name="cleanup">
david_williamsd51e2f12006-12-07 08:19:46 +0000140 </target>
david_williamse24ea0d2009-11-16 13:59:54 +0000141 <!--
142 This run target is the master target that get's all the work
143 done. Most activity is actually done in the 'depends' tasks, but
144 any actions that need to happen after all the tests have been
145 run should go here, such as copying the results to a common
146 'save' directory.
147 -->
148 <target
149 name="run"
david_williams9ef9f652009-11-17 18:37:27 +0000150 depends="init,suite,copylogs,copyxsl,cleanup">
151 <echo
152 message="unit test ran: ${ant.file}"/>
153 <echo
154 message="library-file: ${library-file}"/>
155 </target>
156 <target
157 name="copylogs"
158 if="dotlogavailable">
159 <copy
160 failonerror="false"
161 file="${workspace}/.metadata/.log"
162 tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt"/>
163 </target>
164 <target
165 name="copyxsl">
166 <!-- copy our particular xsl files to web directory for prosperity-->
167 <copy
168 todir="${buildDirectory}/${buildLabel}/"
169 flatten="true">
170 <fileset
david_williams200e9132009-11-24 08:38:28 +0000171 dir="${testRoot}${dropinsFolder}/eclipse/plugins/">
david_williams9ef9f652009-11-17 18:37:27 +0000172 <include
173 name="**/org.eclipse.wtp.releng.tests*/*.xsl"/>
174 </fileset>
175 </copy>
176 <!-- and use them to create basic display -->
177 <xslt
178 basedir="${buildDirectory}/${buildLabel}/"
179 includes="versioningReport_*"
180 destdir="${buildDirectory}/${buildLabel}/"
181 style="versioningReportToHTML.xsl"
182 force="true"/>
183 <echo
184 file="${buildDirectory}/${buildLabel}/versioningReportName.php">
185 <![CDATA[<?php $versionReportFilename="versioningReport_${buildLabel}" ?>]]>
186 </echo>
david_williamsd51e2f12006-12-07 08:19:46 +0000187 </target>
david_williamsd51e2f12006-12-07 08:19:46 +0000188</project>