587
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_imaker.ant.xml
|
|
5 |
Part of : Helium AntLib
|
|
6 |
|
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
All rights reserved.
|
|
9 |
This component and the accompanying materials are made available
|
|
10 |
under the terms of the License "Eclipse Public License v1.0"
|
|
11 |
which accompanies this distribution, and is available
|
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
|
|
14 |
Initial Contributors:
|
|
15 |
Nokia Corporation - initial contribution.
|
|
16 |
|
|
17 |
Contributors:
|
|
18 |
|
|
19 |
Description:
|
|
20 |
|
|
21 |
============================================================================
|
|
22 |
-->
|
|
23 |
<project name="helium-antlib-imaker-unittest" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium Antlib imaker unittests.</description>
|
|
25 |
|
|
26 |
<taskdef resource="com/nokia/helium/imaker/ant/antlib.xml" uri="http://www.nokia.com/helium"/>
|
|
27 |
<property name="epocroot" location="${basedir}/../epocroot_task" />
|
|
28 |
<property name="epocroot.temp" location="${epocroot}/temp" />
|
|
29 |
|
|
30 |
<!-- is called prior to the test -->
|
|
31 |
<target name="setUp">
|
|
32 |
<echo>-------------------------------------------------------------------------------</echo>
|
|
33 |
<delete dir="${epocroot.temp}" failonerror="false" />
|
|
34 |
<delete dir="${epocroot}/epoc32" failonerror="false" />
|
|
35 |
<mkdir dir="${epocroot.temp}" />
|
|
36 |
</target>
|
|
37 |
|
|
38 |
<!-- is called after the test, even if that caused an error -->
|
|
39 |
<target name="tearDown">
|
|
40 |
<delete dir="${epocroot.temp}" failonerror="false" />
|
|
41 |
<delete dir="${epocroot}/epoc32" failonerror="false" />
|
|
42 |
<echo>-------------------------------------------------------------------------------</echo>
|
|
43 |
</target>
|
|
44 |
|
|
45 |
<!-- once imaker is in SymSEE this does not fail
|
|
46 |
<target name="test-imaker-noargs-noconfig">
|
|
47 |
<echo>Will fail because it can't find imaker.</echo>
|
|
48 |
<au:expectfailure>
|
|
49 |
<hlm:imaker />
|
|
50 |
</au:expectfailure>
|
|
51 |
</target> -->
|
|
52 |
|
|
53 |
<target name="test-imaker-epocroot">
|
|
54 |
<echo>Usin custom epocroot.</echo>
|
|
55 |
<hlm:imaker epocroot="${epocroot}" />
|
|
56 |
</target>
|
|
57 |
|
|
58 |
<target name="test-imaker-noargs">
|
|
59 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"/>
|
|
60 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
61 |
</target>
|
|
62 |
|
|
63 |
<target name="test-imaker-empty-imakerconfigurationset">
|
|
64 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
65 |
<hlm:imakerconfigurationset>
|
|
66 |
</hlm:imakerconfigurationset>
|
|
67 |
</hlm:imaker>
|
|
68 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
69 |
<au:assertLogContains text="Nothing to build." />
|
|
70 |
</target>
|
|
71 |
|
|
72 |
<target name="test-imaker-empty-imakerconfiguration-accepted">
|
|
73 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
74 |
<hlm:imakerconfiguration>
|
|
75 |
</hlm:imakerconfiguration>
|
|
76 |
</hlm:imaker>
|
|
77 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
78 |
<au:assertLogContains text="Nothing to build." />
|
|
79 |
</target>
|
|
80 |
|
|
81 |
<target name="test-imaker-empty-imakerconfiguration">
|
|
82 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
83 |
<hlm:imakerconfigurationset>
|
|
84 |
<hlm:imakerconfiguration>
|
|
85 |
</hlm:imakerconfiguration>
|
|
86 |
</hlm:imakerconfigurationset>
|
|
87 |
</hlm:imaker>
|
|
88 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
89 |
<au:assertLogContains text="Nothing to build." />
|
|
90 |
</target>
|
|
91 |
|
|
92 |
<target name="test-imaker-imakerconfiguration-makefileset">
|
|
93 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
94 |
<hlm:imakerconfigurationset>
|
|
95 |
<hlm:imakerconfiguration>
|
|
96 |
<makefileset>
|
|
97 |
<include name="**/product/*ui.mk" />
|
|
98 |
</makefileset>
|
|
99 |
</hlm:imakerconfiguration>
|
|
100 |
</hlm:imakerconfigurationset>
|
|
101 |
</hlm:imaker>
|
|
102 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
103 |
<au:assertLogContains text="Nothing to build." />
|
|
104 |
</target>
|
|
105 |
|
|
106 |
<target name="test-imaker-imakerconfiguration-targetset">
|
|
107 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
108 |
<hlm:imakerconfigurationset>
|
|
109 |
<hlm:imakerconfiguration>
|
|
110 |
<makefileset>
|
|
111 |
<include name="**/product/*ui.mk" />
|
|
112 |
</makefileset>
|
|
113 |
<targetset>
|
|
114 |
<include name="core" />
|
|
115 |
<include name="langpack_\d+" />
|
|
116 |
</targetset>
|
|
117 |
</hlm:imakerconfiguration>
|
|
118 |
</hlm:imakerconfigurationset>
|
|
119 |
</hlm:imaker>
|
|
120 |
<au:assertFileExists file="${epocroot.temp}/output.log" />
|
|
121 |
</target>
|
|
122 |
|
|
123 |
<target name="test-imaker-imakerconfiguration-variableset">
|
|
124 |
<au:expectfailure message="The variable element doesn't define a 'name' attribute.">
|
|
125 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
126 |
<hlm:imakerconfigurationset>
|
|
127 |
<hlm:imakerconfiguration>
|
|
128 |
<makefileset>
|
|
129 |
<include name="**/product/*ui.mk" />
|
|
130 |
</makefileset>
|
|
131 |
<targetset>
|
|
132 |
<include name="core" />
|
|
133 |
<include name="langpack_\d+" />
|
|
134 |
</targetset>
|
|
135 |
<variableset>
|
|
136 |
<variable />
|
|
137 |
</variableset>
|
|
138 |
</hlm:imakerconfiguration>
|
|
139 |
</hlm:imakerconfigurationset>
|
|
140 |
</hlm:imaker>
|
|
141 |
</au:expectfailure>
|
|
142 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
143 |
</target>
|
|
144 |
|
|
145 |
<target name="test-imaker-imakerconfiguration-variablegroup">
|
|
146 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
147 |
<hlm:imakerconfigurationset>
|
|
148 |
<hlm:imakerconfiguration>
|
|
149 |
<makefileset>
|
|
150 |
<include name="**/product/*ui.mk" />
|
|
151 |
</makefileset>
|
|
152 |
<targetset>
|
|
153 |
<include name="core" />
|
|
154 |
<include name="langpack_\d+" />
|
|
155 |
</targetset>
|
|
156 |
<variablegroup>
|
|
157 |
<variable name="TYPE" value="rnd" />
|
|
158 |
</variablegroup>
|
|
159 |
<variablegroup>
|
|
160 |
<variable name="TYPE" value="prd" />
|
|
161 |
</variablegroup>
|
|
162 |
</hlm:imakerconfiguration>
|
|
163 |
</hlm:imakerconfigurationset>
|
|
164 |
</hlm:imaker>
|
|
165 |
<au:assertFileExists file="${epocroot.temp}/output.log" />
|
|
166 |
</target>
|
|
167 |
|
|
168 |
<target name="test-imaker-imakerconfiguration-variablegroup-refid">
|
|
169 |
<hlm:imakerconfigurationset id="config">
|
|
170 |
<hlm:imakerconfiguration>
|
|
171 |
<makefileset>
|
|
172 |
<include name="**/product/*ui.mk" />
|
|
173 |
</makefileset>
|
|
174 |
<targetset>
|
|
175 |
<include name="core" />
|
|
176 |
<include name="langpack_\d+" />
|
|
177 |
</targetset>
|
|
178 |
<variablegroup>
|
|
179 |
<variable name="TYPE" value="rnd" />
|
|
180 |
</variablegroup>
|
|
181 |
<variablegroup>
|
|
182 |
<variable name="TYPE" value="prd" />
|
|
183 |
</variablegroup>
|
|
184 |
</hlm:imakerconfiguration>
|
|
185 |
</hlm:imakerconfigurationset>
|
|
186 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
187 |
<hlm:imakerconfigurationset refid="config"/>
|
|
188 |
</hlm:imaker>
|
|
189 |
<au:assertFileExists file="${epocroot.temp}/output.log" />
|
|
190 |
<au:assertLogDoesntContain text="Nothing to build" />
|
|
191 |
</target>
|
|
192 |
|
|
193 |
<target name="test-imaker-imakerconfiguration-variablegroup-refid-subconfig">
|
|
194 |
<hlm:imakerconfiguration id="subconfig">
|
|
195 |
<makefileset>
|
|
196 |
<include name="**/product/*ui.mk" />
|
|
197 |
</makefileset>
|
|
198 |
<targetset>
|
|
199 |
<include name="core" />
|
|
200 |
<include name="langpack_\d+" />
|
|
201 |
</targetset>
|
|
202 |
<variablegroup>
|
|
203 |
<variable name="TYPE" value="rnd" />
|
|
204 |
</variablegroup>
|
|
205 |
<variablegroup>
|
|
206 |
<variable name="TYPE" value="prd" />
|
|
207 |
</variablegroup>
|
|
208 |
</hlm:imakerconfiguration>
|
|
209 |
<hlm:imakerconfigurationset id="config">
|
|
210 |
<hlm:imakerconfiguration refid="subconfig" />
|
|
211 |
</hlm:imakerconfigurationset>
|
|
212 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
213 |
<hlm:imakerconfigurationset refid="config"/>
|
|
214 |
</hlm:imaker>
|
|
215 |
<au:assertFileExists file="${epocroot.temp}/output.log" />
|
|
216 |
<au:assertLogDoesntContain text="Nothing to build" />
|
|
217 |
</target>
|
|
218 |
|
|
219 |
<target name="test-imaker-imakerconfiguration-variablegroup-product">
|
|
220 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
221 |
<hlm:imakerconfiguration>
|
|
222 |
<hlm:product list="product" ui="true" />
|
|
223 |
<targetset>
|
|
224 |
<include name="core" />
|
|
225 |
<include name="langpack_\d+" />
|
|
226 |
</targetset>
|
|
227 |
<variablegroup>
|
|
228 |
<variable name="TYPE" value="rnd" />
|
|
229 |
</variablegroup>
|
|
230 |
<variablegroup>
|
|
231 |
<variable name="TYPE" value="prd" />
|
|
232 |
</variablegroup>
|
|
233 |
</hlm:imakerconfiguration>
|
|
234 |
</hlm:imaker>
|
|
235 |
<au:assertFileExists file="${epocroot.temp}/output.log" />
|
|
236 |
<au:assertLogDoesntContain text="Nothing to build" />
|
|
237 |
</target>
|
|
238 |
|
|
239 |
<target name="test-imaker-imakerconfiguration-variablegroup-product-invalid">
|
|
240 |
<au:expectfailure message="Could not find a valid configuration for product_invalid">
|
|
241 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
242 |
<hlm:imakerconfiguration>
|
|
243 |
<hlm:product list="product_invalid" ui="true" />
|
|
244 |
<targetset>
|
|
245 |
<include name="core" />
|
|
246 |
<include name="langpack_\d+" />
|
|
247 |
</targetset>
|
|
248 |
<variablegroup>
|
|
249 |
<variable name="TYPE" value="rnd" />
|
|
250 |
</variablegroup>
|
|
251 |
<variablegroup>
|
|
252 |
<variable name="TYPE" value="prd" />
|
|
253 |
</variablegroup>
|
|
254 |
</hlm:imakerconfiguration>
|
|
255 |
</hlm:imaker>
|
|
256 |
</au:expectfailure>
|
|
257 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
258 |
</target>
|
|
259 |
|
|
260 |
<target name="test-imaker-imakerconfiguration-variablegroup-product-invalid-notfail">
|
|
261 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log">
|
|
262 |
<hlm:imakerconfiguration>
|
|
263 |
<hlm:product list="product_invalid" ui="true" failonerror="false" />
|
|
264 |
<targetset>
|
|
265 |
<include name="core" />
|
|
266 |
<include name="langpack_\d+" />
|
|
267 |
</targetset>
|
|
268 |
<variablegroup>
|
|
269 |
<variable name="TYPE" value="rnd" />
|
|
270 |
</variablegroup>
|
|
271 |
<variablegroup>
|
|
272 |
<variable name="TYPE" value="prd" />
|
|
273 |
</variablegroup>
|
|
274 |
</hlm:imakerconfiguration>
|
|
275 |
</hlm:imaker>
|
|
276 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
277 |
<au:assertLogContains text="Could not find a valid configuration for product_invalid" />
|
|
278 |
<au:assertLogContains text="Nothing to build." />
|
|
279 |
</target>
|
|
280 |
|
618
|
281 |
<target name="test-imaker-imakerconfiguration-variableset-invalid-engine">
|
|
282 |
<au:expectfailure message="Could not find engine reference: 'invalid.engine.ref'.">
|
|
283 |
<hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log" engineRefid="invalid.engine.ref">
|
|
284 |
<hlm:imakerconfiguration>
|
|
285 |
<makefileset>
|
|
286 |
<include name="**/product/*ui.mk" />
|
|
287 |
</makefileset>
|
|
288 |
<targetset>
|
|
289 |
<include name="core" />
|
|
290 |
<include name="langpack_\d+" />
|
|
291 |
</targetset>
|
|
292 |
<variablegroup>
|
|
293 |
<variable name="TYPE" value="rnd" />
|
|
294 |
</variablegroup>
|
|
295 |
<variablegroup>
|
|
296 |
<variable name="TYPE" value="prd" />
|
|
297 |
</variablegroup>
|
|
298 |
</hlm:imakerconfiguration>
|
|
299 |
</hlm:imaker>
|
|
300 |
</au:expectfailure>
|
|
301 |
<au:assertLogContains text="Using engine: invalid.engine.ref" />
|
|
302 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.log" />
|
|
303 |
</target>
|
|
304 |
|
587
|
305 |
</project>
|