19 #Description: |
19 #Description: |
20 #=============================================================================== |
20 #=============================================================================== |
21 |
21 |
22 """Parse Symbian SW component for ATS3 testing related information""" |
22 """Parse Symbian SW component for ATS3 testing related information""" |
23 |
23 |
24 # pylint: disable-msg=R0902,R0912,R0901,R0915,R0201 |
24 |
25 #R* remove during refactoring |
25 #R* remove during refactoring |
26 |
26 |
27 from path import path # pylint: disable-msg=F0401 |
27 from path import path # pylint: disable-msg=F0401 |
28 import ats3.parsers as parser |
28 import ats3.parsers as parser |
29 import logging |
29 import logging |
98 engine_ini_file = None |
98 engine_ini_file = None |
99 test_harness = self.cfg_harness |
99 test_harness = self.cfg_harness |
100 src_dst = [] |
100 src_dst = [] |
101 pmd_files = [] |
101 pmd_files = [] |
102 trace_activation_files = [] |
102 trace_activation_files = [] |
|
103 dll_files = {} |
103 |
104 |
104 if not os.path.exists( self.tsrc_dir ): |
105 if not os.path.exists( self.tsrc_dir ): |
105 _logger.error("Missing test source directory: %s", self.tsrc_dir) |
106 _logger.error("Missing test source directory: %s", self.tsrc_dir) |
106 else: |
107 else: |
107 self.custom_dir = self.tsrc_dir.joinpath("custom") |
108 self.custom_dir = self.tsrc_dir.joinpath("custom") |
133 src_dst = self.insert_testset_stif(src_dst, pkg_paths) |
134 src_dst = self.insert_testset_stif(src_dst, pkg_paths) |
134 |
135 |
135 elif test_harness == "EUNIT": |
136 elif test_harness == "EUNIT": |
136 try: |
137 try: |
137 src_dst = pkg_parser.get_data_files(self.tsrc_pkg_files(_paths_dict_), self.build_drive) |
138 src_dst = pkg_parser.get_data_files(self.tsrc_pkg_files(_paths_dict_), self.build_drive) |
|
139 #collecting dll files and their harness for the test component, it will be |
|
140 # compared while writing 'execute' step in the test.xml generation |
|
141 for sub_component in _paths_dict_[tsrc_dir]['content'].keys(): |
|
142 dll_files.update(_paths_dict_[tsrc_dir]['content'][sub_component]['dll_files']) |
138 |
143 |
139 except OSError: |
144 except OSError: |
140 _logger.warning("No pkg file found in the directory ( %s )" % self.tsrc_pkg_dir) |
145 _logger.warning("No pkg file found in the directory ( %s )" % self.tsrc_pkg_dir) |
141 src_dst = [] |
146 src_dst = [] |
142 except IndexError: |
147 except IndexError: |
185 test_harness=test_harness, |
190 test_harness=test_harness, |
186 src_dst=src_dst, |
191 src_dst=src_dst, |
187 pmd_files=pmd_files, |
192 pmd_files=pmd_files, |
188 trace_activation_files=trace_activation_files, |
193 trace_activation_files=trace_activation_files, |
189 custom_dir=self.custom_dir, |
194 custom_dir=self.custom_dir, |
|
195 dll_files=dll_files, |
190 component_path=tsrc_dir) |
196 component_path=tsrc_dir) |
191 else: |
197 else: |
192 test_plan.insert_set(image_files=self.flash_images, |
198 test_plan.insert_set(image_files=self.flash_images, |
193 sis_files=self.sis_files, |
199 sis_files=self.sis_files, |
194 test_timeout=list(self.test_timeout), |
200 test_timeout=list(self.test_timeout), |
195 test_harness=test_harness, |
201 test_harness=test_harness, |
196 src_dst=src_dst, |
202 src_dst=src_dst, |
197 custom_dir=self.custom_dir, |
203 custom_dir=self.custom_dir, |
|
204 dll_files = dll_files, |
198 component_path=tsrc_dir) |
205 component_path=tsrc_dir) |
199 else: |
206 else: |
200 if self.trace_enabled == "True": |
207 if self.trace_enabled == "True": |
201 test_plan.insert_set(data_files=tsrc_testdata_files, |
208 test_plan.insert_set(data_files=tsrc_testdata_files, |
202 config_files=tsrc_config_files, |
209 config_files=tsrc_config_files, |
208 test_harness=test_harness, |
215 test_harness=test_harness, |
209 src_dst=src_dst, |
216 src_dst=src_dst, |
210 pmd_files=pmd_files, |
217 pmd_files=pmd_files, |
211 trace_activation_files=trace_activation_files, |
218 trace_activation_files=trace_activation_files, |
212 custom_dir=self.custom_dir, |
219 custom_dir=self.custom_dir, |
|
220 dll_files = dll_files, |
213 component_path=tsrc_dir) |
221 component_path=tsrc_dir) |
214 else: |
222 else: |
215 test_plan.insert_set(image_files=self.flash_images, |
223 test_plan.insert_set(image_files=self.flash_images, |
216 sis_files=self.sis_files, |
224 sis_files=self.sis_files, |
217 test_timeout=list(self.test_timeout), |
225 test_timeout=list(self.test_timeout), |
218 test_harness=test_harness, |
226 test_harness=test_harness, |
219 src_dst=src_dst, |
227 src_dst=src_dst, |
220 custom_dir=self.custom_dir, |
228 custom_dir=self.custom_dir, |
|
229 dll_files = dll_files, |
221 component_path=tsrc_dir) |
230 component_path=tsrc_dir) |
222 |
231 |
223 def check_dll_duplication(self, _dll_file_, _src_dst_ ): |
232 def check_dll_duplication(self, _dll_file_, _src_dst_ ): |
224 """Checks if the dll is already in the dictionary, created by pkg file""" |
233 """Checks if the dll is already in the dictionary, created by pkg file""" |
225 for item in _src_dst_: |
234 for item in _src_dst_: |
226 first = item[0] |
235 first = item[0] |
227 return _dll_file_.lower() in first.lower() |
236 if _dll_file_.lower() in first.lower(): |
|
237 return True |
|
238 return False |
228 |
239 |
229 @property |
240 @property |
230 def tsrc_bld_dir(self): |
241 def tsrc_bld_dir(self): |
231 """Component's build directory.""" |
242 """Component's build directory.""" |
232 return self.tsrc_dir |
243 return self.tsrc_dir |