|
1 |
|
2 from raptor_tests import SmokeTest |
|
3 from raptor_tests import AntiTargetSmokeTest |
|
4 |
|
5 def run(): |
|
6 result = SmokeTest.PASS |
|
7 failed = [] |
|
8 |
|
9 t = SmokeTest() |
|
10 t.description = "Testcases (ID 0101a - 0101d) test trace compiler" |
|
11 # General test for trace compiler, which generates |
|
12 # 1. trace headers like <source>Traces.h |
|
13 # 2. fixed_id.definitions |
|
14 # 3. dictionary files like <project name>_<UID>_Dictionary.xml |
|
15 # 4. trace definitions like <project name>_<UID>_TraceDefinitions.h |
|
16 t.id = "101a" |
|
17 t.name = "TC_general" |
|
18 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/testTC/group/bld.inf -c armv5.tracecompiler" |
|
19 t.targets = [ |
|
20 "$(EPOCROOT)/epoc32/release/armv5/lib/testTC.dso", |
|
21 "$(EPOCROOT)/epoc32/release/armv5/lib/testTC{000a0000}.dso", |
|
22 "$(EPOCROOT)/epoc32/release/armv5/udeb/testTC.dll", |
|
23 "$(EPOCROOT)/epoc32/release/armv5/udeb/testTC.dll.map", |
|
24 "$(EPOCROOT)/epoc32/release/armv5/urel/testTC.dll", |
|
25 "$(EPOCROOT)/epoc32/release/armv5/urel/testTC.dll.map", |
|
26 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitTraces.h", |
|
27 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitmainTraces.h", |
|
28 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitpermparserTraces.h", |
|
29 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/fixed_id.definitions", |
|
30 "$(EPOCROOT)/epoc32/ost_dictionaries/testTC_0x1000008d_Dictionary.xml", |
|
31 "$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/testTC_0x1000008d_TraceDefinitions.h" |
|
32 ] |
|
33 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/testTC/group/bld.inf', [ |
|
34 "testtc_dll/armv5/udeb/wlanhwinit.o", |
|
35 "testtc_dll/armv5/udeb/wlanhwinit.o.d", |
|
36 "testtc_dll/armv5/udeb/wlanhwinitmain.o", |
|
37 "testtc_dll/armv5/udeb/wlanhwinitmain.o.d", |
|
38 "testtc_dll/armv5/udeb/wlanhwinitpermparser.o", |
|
39 "testtc_dll/armv5/udeb/wlanhwinitpermparser.o.d", |
|
40 "testtc_dll/armv5/udeb/testTC_udeb_objects.via", |
|
41 "testtc_dll/armv5/udeb/testTC{000a0000}.def", |
|
42 "testtc_dll/armv5/urel/wlanhwinit.o", |
|
43 "testtc_dll/armv5/urel/wlanhwinit.o.d", |
|
44 "testtc_dll/armv5/urel/wlanhwinitmain.o", |
|
45 "testtc_dll/armv5/urel/wlanhwinitmain.o.d", |
|
46 "testtc_dll/armv5/urel/wlanhwinitpermparser.o", |
|
47 "testtc_dll/armv5/urel/wlanhwinitpermparser.o.d", |
|
48 "testtc_dll/armv5/urel/testTC_urel_objects.via", |
|
49 "testtc_dll/armv5/urel/testTC{000a0000}.def", |
|
50 "testtc_dll/tracecompile_testTC_1000008d.done" |
|
51 ]) |
|
52 # Trace compiler doesn't work on Linux for time being. Once it's fixed, will apply all |
|
53 # trace compiler tests to linux as well. |
|
54 t.run("windows") |
|
55 if t.result == SmokeTest.FAIL: |
|
56 result = SmokeTest.FAIL |
|
57 failed.append(t.name) |
|
58 |
|
59 # General CLEAN test for trace compiler outputs |
|
60 t = AntiTargetSmokeTest() |
|
61 t.id = "101b" |
|
62 t.name = "TC_general_CLEAN" |
|
63 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/testTC/group/bld.inf -c armv5.tracecompiler CLEAN" |
|
64 t.antitargets = [ |
|
65 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitTraces.h", |
|
66 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitmainTraces.h", |
|
67 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitpermparserTraces.h" |
|
68 ] |
|
69 t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
70 "testtc_dll/tracecompile_testTC_1000008d.done" |
|
71 ]) |
|
72 t.run("windows") |
|
73 if t.result == SmokeTest.FAIL: |
|
74 result = SmokeTest.FAIL |
|
75 failed.append(t.name) |
|
76 |
|
77 t = SmokeTest() |
|
78 t.id = "101c" |
|
79 t.name = "TC_bv_path" |
|
80 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_featurevariant/group/bld.inf -c armv5.tracecompiler" |
|
81 t.targets = [ |
|
82 "$(EPOCROOT)/epoc32/release/armv5/udeb/HelloWorld.exe", |
|
83 "$(EPOCROOT)/epoc32/release/armv5/udeb/HelloWorld.exe.map", |
|
84 "$(EPOCROOT)/epoc32/release/armv5/urel/HelloWorld.exe", |
|
85 "$(EPOCROOT)/epoc32/release/armv5/urel/HelloWorld.exe.map", |
|
86 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/TC_featurevariant/traces/HelloWorldTraces.h", |
|
87 "$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/TC_featurevariant/traces/fixed_id.definitions", |
|
88 "$(EPOCROOT)/epoc32/ost_dictionaries/HelloWorld_0xe78a5aa3_Dictionary.xml", |
|
89 "$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/HelloWorld_0xe78a5aa3_TraceDefinitions.h" |
|
90 ] |
|
91 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_featurevariant/group/bld.inf', [ |
|
92 "helloworld_exe/armv5/udeb/HelloWorld.o", |
|
93 "helloworld_exe/armv5/udeb/HelloWorld.o.d", |
|
94 "helloworld_exe/armv5/udeb/HelloWorld_udeb_objects.via", |
|
95 "helloworld_exe/armv5/urel/HelloWorld.o", |
|
96 "helloworld_exe/armv5/urel/HelloWorld.o.d", |
|
97 "helloworld_exe/armv5/urel/HelloWorld_urel_objects.via", |
|
98 "helloworld_exe/tracecompile_HelloWorld_e78a5aa3.done" |
|
99 ]) |
|
100 t.run("windows") |
|
101 if t.result == SmokeTest.FAIL: |
|
102 result = SmokeTest.FAIL |
|
103 failed.append(t.name) |
|
104 |
|
105 # 101d-101f test trace compiler auto mechanism, which is used to avoid wasting time on source |
|
106 # containing no osttraces. |
|
107 # Trace compiler only runs when there are osttraces code in source. Raptor decides this by |
|
108 # checking whether there is a "traces" or "traces_<prj_name>" folder in USERINCLUDE in a mmp file. |
|
109 t = SmokeTest() |
|
110 t.id = "101d" |
|
111 t.name = "TC_autorun1" |
|
112 # Run - USERINCLUDE ../traces_autorun1 |
|
113 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
114 " -p autorun1.mmp" |
|
115 t.targets = [ |
|
116 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", |
|
117 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
118 ] |
|
119 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
120 "test_/armv5/udeb/test.o", |
|
121 "test_/armv5/urel/test.o", |
|
122 "test_/tracecompile_autorun1_00000001.done" |
|
123 ]) |
|
124 t.run("windows") |
|
125 if t.result == SmokeTest.FAIL: |
|
126 result = SmokeTest.FAIL |
|
127 failed.append(t.name) |
|
128 |
|
129 t = AntiTargetSmokeTest() |
|
130 t.id = "101e" |
|
131 t.name = "TC_autorun2" |
|
132 # No run - USERINCLUDE ./tracesnotmatch |
|
133 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
134 " -p autorun2.mmp CLEAN " + \ |
|
135 "&& sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
136 " -p autorun2.mmp" |
|
137 t.targets = [ |
|
138 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", |
|
139 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
140 ] |
|
141 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
142 "test_/armv5/udeb/test.o", |
|
143 "test_/armv5/urel/test.o", |
|
144 ]) |
|
145 t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
146 "test_/tracecompile_autorun2_00000001.done" |
|
147 ]) |
|
148 t.run("windows") |
|
149 if t.result == SmokeTest.FAIL: |
|
150 result = SmokeTest.FAIL |
|
151 failed.append(t.name) |
|
152 |
|
153 t = AntiTargetSmokeTest() |
|
154 t.id = "101f" |
|
155 t.name = "TC_autorun3" |
|
156 # No run - no UID |
|
157 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
158 " -p autorun3.mmp CLEAN " + \ |
|
159 "&& sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
160 " -p autorun3.mmp" |
|
161 t.targets = [ |
|
162 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", |
|
163 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
164 ] |
|
165 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
166 "test_/armv5/udeb/test.o", |
|
167 "test_/armv5/urel/test.o", |
|
168 ]) |
|
169 t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
170 "test_/tracecompile_autorun3_00000001.done" |
|
171 ]) |
|
172 t.run("windows") |
|
173 if t.result == SmokeTest.FAIL: |
|
174 result = SmokeTest.FAIL |
|
175 failed.append(t.name) |
|
176 |
|
177 # Test trace compiler doesn't run when it is switched off |
|
178 # Trace compiler switch is off by default. To turn it on use variant ".tracecompiler". |
|
179 t = AntiTargetSmokeTest() |
|
180 t.id = "101g" |
|
181 t.name = "TC_switch_off" |
|
182 t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \ |
|
183 " -p autorun1.mmp CLEAN " + \ |
|
184 "&& sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5 -p autorun1.mmp" |
|
185 t.targets = [ |
|
186 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", |
|
187 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
188 ] |
|
189 t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
190 "test_/armv5/udeb/test.o", |
|
191 "test_/armv5/urel/test.o" |
|
192 ]) |
|
193 t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [ |
|
194 "test_/tracecompile_autorun1_00000001.done" |
|
195 ]) |
|
196 t.run("windows") |
|
197 if t.result == SmokeTest.FAIL: |
|
198 result = SmokeTest.FAIL |
|
199 failed.append(t.name) |
|
200 |
|
201 |
|
202 t.name = "traceccompiler_general" |
|
203 t.result = result |
|
204 |
|
205 print "\nOverall Result : " + result.upper() + "\n" |
|
206 if result == SmokeTest.FAIL: |
|
207 print len(failed), "tests failed:" |
|
208 for x in failed: |
|
209 print x |
|
210 print |
|
211 |
|
212 return t |
|
213 |