|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 |
|
17 import os |
|
18 import os.path |
|
19 from raptor_tests import SmokeTest |
|
20 |
|
21 def run(): |
|
22 t = SmokeTest() |
|
23 t.logfileOption = lambda :"" |
|
24 t.id = "0074a" |
|
25 t.name = "configpath" |
|
26 t.description = """Test --configpath option for sbs. Specify two remote |
|
27 locations and use the variants in those folders along with ones in |
|
28 each of the default folders.""" |
|
29 |
|
30 # the variants here affect compile steps so we only need to see a single compile |
|
31 # to know whether the variant is doing its thing or not. |
|
32 t.addbuildtargets("smoke_suite/test_resources/simple/bld.inf", |
|
33 ["test_/armv5/udeb/test.o"]) |
|
34 |
|
35 result = SmokeTest.PASS |
|
36 |
|
37 # the extra config folders are |
|
38 # smoke_suite/test_resources/configpathtest/v{2,3} |
|
39 sbshome = os.environ["SBS_HOME"].replace("\\","/") |
|
40 |
|
41 aFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v2" |
|
42 bFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v3" |
|
43 |
|
44 common = "sbs -b smoke_suite/test_resources/simple/bld.inf " + \ |
|
45 "-c armv5.configpathtest1.configpathtest2.configpathtest3" |
|
46 |
|
47 # run the command using the built-in default systemConfig |
|
48 t.command = common + " --configpath=" + aFolder + os.pathsep + bFolder + \ |
|
49 " -f -" |
|
50 |
|
51 t.mustmatch = [ |
|
52 ".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*", |
|
53 ".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*", |
|
54 ".*Duplicate variant 'configpathtest3'.*", |
|
55 ".*-DTESTPASSED.*", |
|
56 ".*-DOSVARIANT95WASAPPLIED.*" |
|
57 ] |
|
58 t.mustnotmatch = [ |
|
59 ".*sbs: error: Unknown variant.*", |
|
60 ".*-DTESTFAILED.*" |
|
61 ] |
|
62 # Duplicate variant is Info not Warn |
|
63 t.warnings = 0 |
|
64 t.run() |
|
65 |
|
66 if t.result == SmokeTest.FAIL: |
|
67 result = SmokeTest.FAIL |
|
68 |
|
69 # run the command again using a systemConfig from $HOME/.sbs_init.xml |
|
70 # and the configpath as two separate options. |
|
71 t.usebash = True |
|
72 homedir = sbshome + "/test/smoke_suite/test_resources/configpathtest/home" |
|
73 t.command = "export HOME=" + homedir + "; " + common + \ |
|
74 " --configpath=" + aFolder + " --configpath=" + bFolder + " -f -" |
|
75 t.id = "0074b" |
|
76 t.mustmatch = [ |
|
77 ".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*", |
|
78 ".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*", |
|
79 ".*Duplicate variant 'configpathtest3'.*" |
|
80 ] |
|
81 t.mustnotmatch = [ |
|
82 ".*sbs: error: Unknown variant.*" |
|
83 ] |
|
84 t.run() |
|
85 |
|
86 if t.result == SmokeTest.FAIL: |
|
87 result = SmokeTest.FAIL |
|
88 |
|
89 # Clean |
|
90 t.mustmatch = [] |
|
91 t.targets = [] |
|
92 t.id = "0074c" |
|
93 t.name = "CLEAN" |
|
94 t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 " + \ |
|
95 "REALLYCLEAN" |
|
96 t.run() # Does not contribute to results |
|
97 |
|
98 t.id = "74" |
|
99 t.name = "configpath" |
|
100 t.result = result |
|
101 t.print_result() |
|
102 return t |
|
103 |