69 } |
68 } |
70 } |
69 } |
71 if (sdk != null) { |
70 if (sdk != null) { |
72 winscwContext = new SymbianBuildContext(sdk, "WINSCW", "UDEB"); |
71 winscwContext = new SymbianBuildContext(sdk, "WINSCW", "UDEB"); |
73 armv5Context = new SymbianBuildContext(sdk, "ARMV5", "UDEB"); |
72 armv5Context = new SymbianBuildContext(sdk, "ARMV5", "UDEB"); |
74 armiContext = new SymbianBuildContext(sdk, "ARMI", "UREL"); |
|
75 gcceContext = new SymbianBuildContext(sdk, "GCCE", "UREL"); |
73 gcceContext = new SymbianBuildContext(sdk, "GCCE", "UREL"); |
76 buildContexts.add(winscwContext); |
74 buildContexts.add(winscwContext); |
77 buildContexts.add(armv5Context); |
75 buildContexts.add(armv5Context); |
78 buildContexts.add(armiContext); |
|
79 buildContexts.add(gcceContext); |
76 buildContexts.add(gcceContext); |
80 } |
77 } |
81 } |
78 } |
82 |
79 |
83 private void assertDefFile(String mmpText, ISymbianBuildContext context, String projPathStr) { |
80 private void assertDefFile(String mmpText, ISymbianBuildContext context, String projPathStr) { |
85 |
82 |
86 DefaultMMPViewConfiguration viewConfiguration = new DefaultMMPViewConfiguration(context, projectPath.append("group/bld.inf"), new AcceptedNodesViewFilter()); |
83 DefaultMMPViewConfiguration viewConfiguration = new DefaultMMPViewConfiguration(context, projectPath.append("group/bld.inf"), new AcceptedNodesViewFilter()); |
87 |
84 |
88 if (context == winscwContext) { |
85 if (context == winscwContext) { |
89 viewConfiguration.getExtraMacros().add(DefineFactory.createSimpleFreeformDefine("WINS")); |
86 viewConfiguration.getExtraMacros().add(DefineFactory.createSimpleFreeformDefine("WINS")); |
90 } else if (context == armiContext) { |
|
91 viewConfiguration.getExtraMacros().add(DefineFactory.createSimpleFreeformDefine("GCC32")); |
|
92 } |
87 } |
93 |
88 |
94 ((DefaultViewParserConfiguration)viewConfiguration.getViewParserConfiguration()).setProjectPath(projectPath); |
89 ((DefaultViewParserConfiguration)viewConfiguration.getViewParserConfiguration()).setProjectPath(projectPath); |
95 |
90 |
96 IMMPView mmpView = getView(viewConfiguration); |
91 IMMPView mmpView = getView(viewConfiguration); |
175 // default filename |
170 // default filename |
176 String text = "TARGETTYPE DlL"; |
171 String text = "TARGETTYPE DlL"; |
177 |
172 |
178 assertDefFile(text, winscwContext, "bwins/unnamedU.def"); |
173 assertDefFile(text, winscwContext, "bwins/unnamedU.def"); |
179 assertDefFile(text, armv5Context, "eabi/unnamedU.def"); |
174 assertDefFile(text, armv5Context, "eabi/unnamedU.def"); |
180 assertDefFile(text, armiContext, "bmarm/unnamedU.def"); |
|
181 assertDefFile(text, gcceContext, "eabi/unnamedU.def"); |
175 assertDefFile(text, gcceContext, "eabi/unnamedU.def"); |
182 |
176 |
183 // target-based filename |
177 // target-based filename |
184 text = "TARGET foo.dll\n"+ |
178 text = "TARGET foo.dll\n"+ |
185 "TARGETTYPE EXEdll\n"; |
179 "TARGETTYPE EXEdll\n"; |
186 assertDefFile(text, winscwContext, "bwins/fooU.def"); |
180 assertDefFile(text, winscwContext, "bwins/fooU.def"); |
187 assertDefFile(text, armv5Context, "eabi/fooU.def"); |
181 assertDefFile(text, armv5Context, "eabi/fooU.def"); |
188 assertDefFile(text, armiContext, "bmarm/fooU.def"); |
|
189 assertDefFile(text, gcceContext, "eabi/fooU.def"); |
182 assertDefFile(text, gcceContext, "eabi/fooU.def"); |
190 |
183 |
191 // default filename, no U |
184 // default filename, no U |
192 text = "NOSTRICTDEF\n"+ |
185 text = "NOSTRICTDEF\n"+ |
193 "TARGETTYPE DlL"; |
186 "TARGETTYPE DlL"; |
194 |
187 |
195 assertDefFile(text, winscwContext, "bwins/unnamed.def"); |
188 assertDefFile(text, winscwContext, "bwins/unnamed.def"); |
196 assertDefFile(text, armv5Context, "eabi/unnamed.def"); |
189 assertDefFile(text, armv5Context, "eabi/unnamed.def"); |
197 assertDefFile(text, armiContext, "bmarm/unnamed.def"); |
|
198 assertDefFile(text, gcceContext, "eabi/unnamed.def"); |
190 assertDefFile(text, gcceContext, "eabi/unnamed.def"); |
199 |
191 |
200 // target-based filename, no U |
192 // target-based filename, no U |
201 text = "NOSTRICTDEF\n"+ |
193 text = "NOSTRICTDEF\n"+ |
202 "TARGET foo.dll\n"+ |
194 "TARGET foo.dll\n"+ |
203 "TARGETTYPE EXEdll\n"; |
195 "TARGETTYPE EXEdll\n"; |
204 assertDefFile(text, winscwContext, "bwins/foo.def"); |
196 assertDefFile(text, winscwContext, "bwins/foo.def"); |
205 assertDefFile(text, armv5Context, "eabi/foo.def"); |
197 assertDefFile(text, armv5Context, "eabi/foo.def"); |
206 assertDefFile(text, armiContext, "bmarm/foo.def"); |
|
207 assertDefFile(text, gcceContext, "eabi/foo.def"); |
198 assertDefFile(text, gcceContext, "eabi/foo.def"); |
208 } |
199 } |
209 |
200 |
210 public void testRealFilename() throws Exception { |
201 public void testRealFilename() throws Exception { |
211 if (sdk == null) |
202 if (sdk == null) |
218 String text = "TARGETTYPE DlL\n"+ |
209 String text = "TARGETTYPE DlL\n"+ |
219 "DEFFILE myfile.def"; |
210 "DEFFILE myfile.def"; |
220 |
211 |
221 assertDefFile(text, winscwContext, "bwins/myfileU.def"); |
212 assertDefFile(text, winscwContext, "bwins/myfileU.def"); |
222 assertDefFile(text, armv5Context, "eabi/myfileU.def"); |
213 assertDefFile(text, armv5Context, "eabi/myfileU.def"); |
223 assertDefFile(text, armiContext, "bmarm/myfileU.def"); |
|
224 assertDefFile(text, gcceContext, "eabi/myfileU.def"); |
214 assertDefFile(text, gcceContext, "eabi/myfileU.def"); |
225 |
215 |
226 // target-based filename, no U |
216 // target-based filename, no U |
227 text = "NOSTRICTDEF\n"+ |
217 text = "NOSTRICTDEF\n"+ |
228 "TARGET foo.dll\n"+ |
218 "TARGET foo.dll\n"+ |
229 "TARGETTYPE EXEdll\n"+ |
219 "TARGETTYPE EXEdll\n"+ |
230 "DEFFILE myfile"; |
220 "DEFFILE myfile"; |
231 assertDefFile(text, winscwContext, "bwins/myfile.def"); |
221 assertDefFile(text, winscwContext, "bwins/myfile.def"); |
232 assertDefFile(text, armv5Context, "eabi/myfile.def"); |
222 assertDefFile(text, armv5Context, "eabi/myfile.def"); |
233 assertDefFile(text, armiContext, "bmarm/myfile.def"); |
|
234 assertDefFile(text, gcceContext, "eabi/myfile.def"); |
223 assertDefFile(text, gcceContext, "eabi/myfile.def"); |
235 |
224 |
236 } |
225 } |
237 |
226 |
238 public void testRealFilenameAndDirectory() throws Exception { |
227 public void testRealFilenameAndDirectory() throws Exception { |
244 String text = "TARGETTYPE DlL\n"+ |
233 String text = "TARGETTYPE DlL\n"+ |
245 "DEFFILE ..\\myfile.def"; |
234 "DEFFILE ..\\myfile.def"; |
246 |
235 |
247 assertDefFile(text, winscwContext, "myfileU.def"); |
236 assertDefFile(text, winscwContext, "myfileU.def"); |
248 assertDefFile(text, armv5Context, "myfileU.def"); |
237 assertDefFile(text, armv5Context, "myfileU.def"); |
249 assertDefFile(text, armiContext, "myfileU.def"); |
|
250 assertDefFile(text, gcceContext, "myfileU.def"); |
238 assertDefFile(text, gcceContext, "myfileU.def"); |
251 |
239 |
252 text = "NOSTRICTDEF\n"+ |
240 text = "NOSTRICTDEF\n"+ |
253 "DEFFILE ..\\myfile"; |
241 "DEFFILE ..\\myfile"; |
254 assertDefFile(text, winscwContext, "myfile.def"); |
242 assertDefFile(text, winscwContext, "myfile.def"); |
255 assertDefFile(text, armv5Context, "myfile.def"); |
243 assertDefFile(text, armv5Context, "myfile.def"); |
256 assertDefFile(text, armiContext, "myfile.def"); |
|
257 assertDefFile(text, gcceContext, "myfile.def"); |
244 assertDefFile(text, gcceContext, "myfile.def"); |
258 |
245 |
259 } |
246 } |
260 |
247 |
261 public void testDirectory() throws Exception { |
248 public void testDirectory() throws Exception { |
268 "TARGET myfile.dll\n"+ |
255 "TARGET myfile.dll\n"+ |
269 "DEFFILE deffiles\\ "; |
256 "DEFFILE deffiles\\ "; |
270 |
257 |
271 assertDefFile(text, winscwContext, "group/deffiles/myfileU.def"); |
258 assertDefFile(text, winscwContext, "group/deffiles/myfileU.def"); |
272 assertDefFile(text, armv5Context, "group/deffiles/myfileU.def"); |
259 assertDefFile(text, armv5Context, "group/deffiles/myfileU.def"); |
273 assertDefFile(text, armiContext, "group/deffiles/myfileU.def"); |
|
274 assertDefFile(text, gcceContext, "group/deffiles/myfileU.def"); |
260 assertDefFile(text, gcceContext, "group/deffiles/myfileU.def"); |
275 |
261 |
276 // this fixes the directory meaning platform is not supplied |
262 // this fixes the directory meaning platform is not supplied |
277 text = "TARGETTYPE DlL\n"+ |
263 text = "TARGETTYPE DlL\n"+ |
278 "TARGET myfile.dll\n"+ |
264 "TARGET myfile.dll\n"+ |
283 "#else\n"+ |
269 "#else\n"+ |
284 "DEFFILE deffiles\\eabi\\ \n"+ |
270 "DEFFILE deffiles\\eabi\\ \n"+ |
285 "#endif\n"; |
271 "#endif\n"; |
286 assertDefFile(text, winscwContext, "group/deffiles/winscw/myfileU.def"); |
272 assertDefFile(text, winscwContext, "group/deffiles/winscw/myfileU.def"); |
287 assertDefFile(text, armv5Context, "group/deffiles/eabi/myfileU.def"); |
273 assertDefFile(text, armv5Context, "group/deffiles/eabi/myfileU.def"); |
288 assertDefFile(text, armiContext, "group/deffiles/bmarm/myfileU.def"); |
|
289 assertDefFile(text, gcceContext, "group/deffiles/eabi/myfileU.def"); |
274 assertDefFile(text, gcceContext, "group/deffiles/eabi/myfileU.def"); |
290 |
275 |
291 } |
276 } |
292 |
277 |
293 public void testTildeFilename() throws Exception { |
278 public void testTildeFilename() throws Exception { |
298 "TARGET myfile.dll\n"+ |
283 "TARGET myfile.dll\n"+ |
299 "DEFFILE \\~\\release\\deffiles\\ "; |
284 "DEFFILE \\~\\release\\deffiles\\ "; |
300 |
285 |
301 assertDefFile(text, winscwContext, "/bwins/release/deffiles/myfileU.def"); |
286 assertDefFile(text, winscwContext, "/bwins/release/deffiles/myfileU.def"); |
302 assertDefFile(text, armv5Context, "/eabi/release/deffiles/myfileU.def"); |
287 assertDefFile(text, armv5Context, "/eabi/release/deffiles/myfileU.def"); |
303 assertDefFile(text, armiContext, "/bmarm/release/deffiles/myfileU.def"); |
|
304 assertDefFile(text, gcceContext, "/eabi/release/deffiles/myfileU.def"); |
288 assertDefFile(text, gcceContext, "/eabi/release/deffiles/myfileU.def"); |
305 |
289 |
306 text = "TARGETTYPE DlL\n"+ |
290 text = "TARGETTYPE DlL\n"+ |
307 "TARGET myfile.dll\n"+ |
291 "TARGET myfile.dll\n"+ |
308 "DEFFILE ..\\places\\~\\ "; |
292 "DEFFILE ..\\places\\~\\ "; |
309 |
293 |
310 assertDefFile(text, winscwContext, "places/bwins/myfileU.def"); |
294 assertDefFile(text, winscwContext, "places/bwins/myfileU.def"); |
311 assertDefFile(text, armv5Context, "places/eabi/myfileU.def"); |
295 assertDefFile(text, armv5Context, "places/eabi/myfileU.def"); |
312 assertDefFile(text, armiContext, "places/bmarm/myfileU.def"); |
|
313 assertDefFile(text, gcceContext, "places/eabi/myfileU.def"); |
296 assertDefFile(text, gcceContext, "places/eabi/myfileU.def"); |
314 |
297 |
315 text = "TARGETTYPE DlL\n"+ |
298 text = "TARGETTYPE DlL\n"+ |
316 "TARGET myfile.dll\n"+ |
299 "TARGET myfile.dll\n"+ |
317 "DEFFILE .\\~\\file.def "; |
300 "DEFFILE .\\~\\file.def "; |
318 |
301 |
319 assertDefFile(text, winscwContext, "group/bwins/fileU.def"); |
302 assertDefFile(text, winscwContext, "group/bwins/fileU.def"); |
320 assertDefFile(text, armv5Context, "group/eabi/fileU.def"); |
303 assertDefFile(text, armv5Context, "group/eabi/fileU.def"); |
321 assertDefFile(text, armiContext, "group/bmarm/fileU.def"); |
|
322 assertDefFile(text, gcceContext, "group/eabi/fileU.def"); |
304 assertDefFile(text, gcceContext, "group/eabi/fileU.def"); |
323 |
305 |
324 /// |
306 /// |
325 |
307 |
326 text = "TARGETTYPE DlL\n"+ |
308 text = "TARGETTYPE DlL\n"+ |
328 "NOSTRICTDEF\n"+ |
310 "NOSTRICTDEF\n"+ |
329 "DEFFILE \\~\\release\\deffiles\\ "; |
311 "DEFFILE \\~\\release\\deffiles\\ "; |
330 |
312 |
331 assertDefFile(text, winscwContext, "/bwins/release/deffiles/myfile.def"); |
313 assertDefFile(text, winscwContext, "/bwins/release/deffiles/myfile.def"); |
332 assertDefFile(text, armv5Context, "/eabi/release/deffiles/myfile.def"); |
314 assertDefFile(text, armv5Context, "/eabi/release/deffiles/myfile.def"); |
333 assertDefFile(text, armiContext, "/bmarm/release/deffiles/myfile.def"); |
|
334 assertDefFile(text, gcceContext, "/eabi/release/deffiles/myfile.def"); |
315 assertDefFile(text, gcceContext, "/eabi/release/deffiles/myfile.def"); |
335 |
316 |
336 text = "TARGETTYPE DlL\n"+ |
317 text = "TARGETTYPE DlL\n"+ |
337 "TARGET myfile.dll\n"+ |
318 "TARGET myfile.dll\n"+ |
338 "NOSTRICTDEF\n"+ |
319 "NOSTRICTDEF\n"+ |
339 "DEFFILE ..\\places\\~\\ "; |
320 "DEFFILE ..\\places\\~\\ "; |
340 |
321 |
341 assertDefFile(text, winscwContext, "places/bwins/myfile.def"); |
322 assertDefFile(text, winscwContext, "places/bwins/myfile.def"); |
342 assertDefFile(text, armv5Context, "places/eabi/myfile.def"); |
323 assertDefFile(text, armv5Context, "places/eabi/myfile.def"); |
343 assertDefFile(text, armiContext, "places/bmarm/myfile.def"); |
|
344 assertDefFile(text, gcceContext, "places/eabi/myfile.def"); |
324 assertDefFile(text, gcceContext, "places/eabi/myfile.def"); |
345 |
325 |
346 text = "TARGETTYPE DlL\n"+ |
326 text = "TARGETTYPE DlL\n"+ |
347 "TARGET myfile.dll\n"+ |
327 "TARGET myfile.dll\n"+ |
348 "NOSTRICTDEF\n"+ |
328 "NOSTRICTDEF\n"+ |
349 "DEFFILE .\\~\\file.def "; |
329 "DEFFILE .\\~\\file.def "; |
350 |
330 |
351 assertDefFile(text, winscwContext, "group/bwins/file.def"); |
331 assertDefFile(text, winscwContext, "group/bwins/file.def"); |
352 assertDefFile(text, armv5Context, "group/eabi/file.def"); |
332 assertDefFile(text, armv5Context, "group/eabi/file.def"); |
353 assertDefFile(text, armiContext, "group/bmarm/file.def"); |
|
354 assertDefFile(text, gcceContext, "group/eabi/file.def"); |
333 assertDefFile(text, gcceContext, "group/eabi/file.def"); |
355 |
334 |
356 } |
335 } |
357 |
336 |
358 public void testDefFileAPIs() { |
337 public void testDefFileAPIs() { |