|
1 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # template extension makefile test |
|
15 # |
|
16 # |
|
17 |
|
18 use strict; |
|
19 use Test; |
|
20 |
|
21 # how many tests do we plan to run? |
|
22 BEGIN { plan tests => 6 } |
|
23 |
|
24 # remember where we started |
|
25 use Cwd; |
|
26 my $cwd = getcwd(); |
|
27 |
|
28 # change to the test data directory |
|
29 use File::Basename; |
|
30 my $dir = dirname($0); |
|
31 chdir($dir); |
|
32 print "# running in $dir\n"; |
|
33 |
|
34 my $epocroot = $ENV{'EPOCROOT'}; |
|
35 |
|
36 ############################################################################### |
|
37 # THE TESTS # |
|
38 ############################################################################### |
|
39 |
|
40 # check base/copy_default in a [non] feature variant world |
|
41 my $mk = "../../extension/base/copy_default.mk"; |
|
42 my $name = "my_testing"; |
|
43 my $path = "${epocroot}epoc32/release/armv5/udeb/$name"; |
|
44 my $vars = "SHELL=cmd PLATFORM_PATH=armv5 CFG_PATH=udeb SOURCES=$name.01 TARGET=$name.loc"; |
|
45 |
|
46 use File::Copy; |
|
47 copy("$name.01", "$path.01"); # no variants |
|
48 unlink("$path.loc"); |
|
49 |
|
50 system("make -f $mk $vars BLD"); |
|
51 system("make -f $mk $vars RELEASABLES"); |
|
52 |
|
53 print "# checking $path.loc\n"; |
|
54 ok(-f "$path.loc"); |
|
55 |
|
56 unlink("$path.01"); |
|
57 system("make -f $mk $vars CLEAN"); |
|
58 ok(! -f "$path.loc"); |
|
59 |
|
60 my $v1 = "11111111101111111110111111111011"; # variant |
|
61 my $v2 = "22222222202222222220222222222022"; # variant |
|
62 copy("$name.01", "$path.$v1.01"); |
|
63 copy("$name.01", "$path.$v2.01"); |
|
64 |
|
65 system("make -f $mk $vars BLD"); |
|
66 system("make -f $mk $vars RELEASABLES"); |
|
67 |
|
68 print "# checking $path.$v1.loc\n"; |
|
69 ok(-f "$path.$v1.loc"); |
|
70 print "# checking $path.$v2.loc\n"; |
|
71 ok(-f "$path.$v2.loc"); |
|
72 |
|
73 unlink("$path.$v1.01"); |
|
74 unlink("$path.$v2.01"); |
|
75 |
|
76 system("make -f $mk $vars CLEAN"); |
|
77 ok(! -f "$path.$v1.loc"); |
|
78 ok(! -f "$path.$v2.loc"); |
|
79 |
|
80 ############################################################################### |
|
81 # END OF TESTS # |
|
82 ############################################################################### |
|
83 |
|
84 # change back to the starting directory |
|
85 chdir($cwd); |
|
86 |