|
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 <target name="test-imaker-noargs-noconfig"> |
|
46 <echo>Will fail because it can't find imaker.</echo> |
|
47 <au:expectfailure> |
|
48 <hlm:imaker /> |
|
49 </au:expectfailure> |
|
50 </target> |
|
51 |
|
52 <target name="test-imaker-epocroot"> |
|
53 <echo>Usin custom epocroot.</echo> |
|
54 <hlm:imaker epocroot="${epocroot}" /> |
|
55 </target> |
|
56 |
|
57 <target name="test-imaker-noargs"> |
|
58 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"/> |
|
59 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
60 </target> |
|
61 |
|
62 <target name="test-imaker-empty-imakerconfigurationset"> |
|
63 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
64 <hlm:imakerconfigurationset> |
|
65 </hlm:imakerconfigurationset> |
|
66 </hlm:imaker> |
|
67 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
68 <au:assertLogContains text="Nothing to build." /> |
|
69 </target> |
|
70 |
|
71 <target name="test-imaker-empty-imakerconfiguration-accepted"> |
|
72 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
73 <hlm:imakerconfiguration> |
|
74 </hlm:imakerconfiguration> |
|
75 </hlm:imaker> |
|
76 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
77 <au:assertLogContains text="Nothing to build." /> |
|
78 </target> |
|
79 |
|
80 <target name="test-imaker-empty-imakerconfiguration"> |
|
81 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
82 <hlm:imakerconfigurationset> |
|
83 <hlm:imakerconfiguration> |
|
84 </hlm:imakerconfiguration> |
|
85 </hlm:imakerconfigurationset> |
|
86 </hlm:imaker> |
|
87 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
88 <au:assertLogContains text="Nothing to build." /> |
|
89 </target> |
|
90 |
|
91 <target name="test-imaker-imakerconfiguration-makefileset"> |
|
92 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
93 <hlm:imakerconfigurationset> |
|
94 <hlm:imakerconfiguration> |
|
95 <makefileset> |
|
96 <include name="**/product/*ui.mk" /> |
|
97 </makefileset> |
|
98 </hlm:imakerconfiguration> |
|
99 </hlm:imakerconfigurationset> |
|
100 </hlm:imaker> |
|
101 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
102 <au:assertLogContains text="Nothing to build." /> |
|
103 </target> |
|
104 |
|
105 <target name="test-imaker-imakerconfiguration-targetset"> |
|
106 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
107 <hlm:imakerconfigurationset> |
|
108 <hlm:imakerconfiguration> |
|
109 <makefileset> |
|
110 <include name="**/product/*ui.mk" /> |
|
111 </makefileset> |
|
112 <targetset> |
|
113 <include name="core" /> |
|
114 <include name="langpack_\d+" /> |
|
115 </targetset> |
|
116 </hlm:imakerconfiguration> |
|
117 </hlm:imakerconfigurationset> |
|
118 </hlm:imaker> |
|
119 <au:assertFileExists file="${epocroot.temp}/output.log" /> |
|
120 </target> |
|
121 |
|
122 <target name="test-imaker-imakerconfiguration-variableset"> |
|
123 <au:expectfailure message="The variable element doesn't define a 'name' attribute."> |
|
124 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
125 <hlm:imakerconfigurationset> |
|
126 <hlm:imakerconfiguration> |
|
127 <makefileset> |
|
128 <include name="**/product/*ui.mk" /> |
|
129 </makefileset> |
|
130 <targetset> |
|
131 <include name="core" /> |
|
132 <include name="langpack_\d+" /> |
|
133 </targetset> |
|
134 <variableset> |
|
135 <variable /> |
|
136 </variableset> |
|
137 </hlm:imakerconfiguration> |
|
138 </hlm:imakerconfigurationset> |
|
139 </hlm:imaker> |
|
140 </au:expectfailure> |
|
141 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
142 </target> |
|
143 |
|
144 <target name="test-imaker-imakerconfiguration-variablegroup"> |
|
145 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
146 <hlm:imakerconfigurationset> |
|
147 <hlm:imakerconfiguration> |
|
148 <makefileset> |
|
149 <include name="**/product/*ui.mk" /> |
|
150 </makefileset> |
|
151 <targetset> |
|
152 <include name="core" /> |
|
153 <include name="langpack_\d+" /> |
|
154 </targetset> |
|
155 <variablegroup> |
|
156 <variable name="TYPE" value="rnd" /> |
|
157 </variablegroup> |
|
158 <variablegroup> |
|
159 <variable name="TYPE" value="prd" /> |
|
160 </variablegroup> |
|
161 </hlm:imakerconfiguration> |
|
162 </hlm:imakerconfigurationset> |
|
163 </hlm:imaker> |
|
164 <au:assertFileExists file="${epocroot.temp}/output.log" /> |
|
165 </target> |
|
166 |
|
167 <target name="test-imaker-imakerconfiguration-variablegroup-refid"> |
|
168 <hlm:imakerconfigurationset id="config"> |
|
169 <hlm:imakerconfiguration> |
|
170 <makefileset> |
|
171 <include name="**/product/*ui.mk" /> |
|
172 </makefileset> |
|
173 <targetset> |
|
174 <include name="core" /> |
|
175 <include name="langpack_\d+" /> |
|
176 </targetset> |
|
177 <variablegroup> |
|
178 <variable name="TYPE" value="rnd" /> |
|
179 </variablegroup> |
|
180 <variablegroup> |
|
181 <variable name="TYPE" value="prd" /> |
|
182 </variablegroup> |
|
183 </hlm:imakerconfiguration> |
|
184 </hlm:imakerconfigurationset> |
|
185 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
186 <hlm:imakerconfigurationset refid="config"/> |
|
187 </hlm:imaker> |
|
188 <au:assertFileExists file="${epocroot.temp}/output.log" /> |
|
189 <au:assertLogDoesntContain text="Nothing to build" /> |
|
190 </target> |
|
191 |
|
192 <target name="test-imaker-imakerconfiguration-variablegroup-refid-subconfig"> |
|
193 <hlm:imakerconfiguration id="subconfig"> |
|
194 <makefileset> |
|
195 <include name="**/product/*ui.mk" /> |
|
196 </makefileset> |
|
197 <targetset> |
|
198 <include name="core" /> |
|
199 <include name="langpack_\d+" /> |
|
200 </targetset> |
|
201 <variablegroup> |
|
202 <variable name="TYPE" value="rnd" /> |
|
203 </variablegroup> |
|
204 <variablegroup> |
|
205 <variable name="TYPE" value="prd" /> |
|
206 </variablegroup> |
|
207 </hlm:imakerconfiguration> |
|
208 <hlm:imakerconfigurationset id="config"> |
|
209 <hlm:imakerconfiguration refid="subconfig" /> |
|
210 </hlm:imakerconfigurationset> |
|
211 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
212 <hlm:imakerconfigurationset refid="config"/> |
|
213 </hlm:imaker> |
|
214 <au:assertFileExists file="${epocroot.temp}/output.log" /> |
|
215 <au:assertLogDoesntContain text="Nothing to build" /> |
|
216 </target> |
|
217 |
|
218 <target name="test-imaker-imakerconfiguration-variablegroup-product"> |
|
219 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
220 <hlm:imakerconfiguration> |
|
221 <hlm:product list="product" ui="true" /> |
|
222 <targetset> |
|
223 <include name="core" /> |
|
224 <include name="langpack_\d+" /> |
|
225 </targetset> |
|
226 <variablegroup> |
|
227 <variable name="TYPE" value="rnd" /> |
|
228 </variablegroup> |
|
229 <variablegroup> |
|
230 <variable name="TYPE" value="prd" /> |
|
231 </variablegroup> |
|
232 </hlm:imakerconfiguration> |
|
233 </hlm:imaker> |
|
234 <au:assertFileExists file="${epocroot.temp}/output.log" /> |
|
235 <au:assertLogDoesntContain text="Nothing to build" /> |
|
236 </target> |
|
237 |
|
238 <target name="test-imaker-imakerconfiguration-variablegroup-product-invalid"> |
|
239 <au:expectfailure message="Could not find a valid configuration for product_invalid"> |
|
240 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
241 <hlm:imakerconfiguration> |
|
242 <hlm:product list="product_invalid" ui="true" /> |
|
243 <targetset> |
|
244 <include name="core" /> |
|
245 <include name="langpack_\d+" /> |
|
246 </targetset> |
|
247 <variablegroup> |
|
248 <variable name="TYPE" value="rnd" /> |
|
249 </variablegroup> |
|
250 <variablegroup> |
|
251 <variable name="TYPE" value="prd" /> |
|
252 </variablegroup> |
|
253 </hlm:imakerconfiguration> |
|
254 </hlm:imaker> |
|
255 </au:expectfailure> |
|
256 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
257 </target> |
|
258 |
|
259 <target name="test-imaker-imakerconfiguration-variablegroup-product-invalid-notfail"> |
|
260 <hlm:imaker epocroot="${epocroot}" output="${epocroot.temp}/output.log"> |
|
261 <hlm:imakerconfiguration> |
|
262 <hlm:product list="product_invalid" ui="true" failonerror="false" /> |
|
263 <targetset> |
|
264 <include name="core" /> |
|
265 <include name="langpack_\d+" /> |
|
266 </targetset> |
|
267 <variablegroup> |
|
268 <variable name="TYPE" value="rnd" /> |
|
269 </variablegroup> |
|
270 <variablegroup> |
|
271 <variable name="TYPE" value="prd" /> |
|
272 </variablegroup> |
|
273 </hlm:imakerconfiguration> |
|
274 </hlm:imaker> |
|
275 <au:assertFileDoesntExist file="${epocroot.temp}/output.log" /> |
|
276 <au:assertLogContains text="Could not find a valid configuration for product_invalid" /> |
|
277 <au:assertLogContains text="Nothing to build." /> |
|
278 </target> |
|
279 |
|
280 </project> |