Lines Matching refs:uc

30 import unittest_constants as uc  namespace
38 MODULE_CLASS = '%s:%s' % (uc.MODULE_NAME, uc.CLASS_NAME)
39 MODULE_PACKAGE = '%s:%s' % (uc.MODULE_NAME, uc.PACKAGE)
40 CC_MODULE_CLASS = '%s:%s' % (uc.CC_MODULE_NAME, uc.CC_CLASS_NAME)
45 KERNEL_CONFIG_FILE = os.path.join(uc.TEST_DATA_DIR, KERNEL_TEST_CONFIG)
52 uc.CLASS_BUILD_TARGETS, KERNEL_MODULE_CLASS_DATA)
54 uc.MODULE_NAME,
56 uc.MODULE_BUILD_TARGETS,
57 data={constants.TI_FILTER: frozenset([uc.FLAT_METHOD_FILTER]),
58 constants.TI_REL_CONFIG: uc.CONFIG_FILE})
59 MODULE_CLASS_METHOD = '%s#%s' % (MODULE_CLASS, uc.METHOD_NAME)
60 CC_MODULE_CLASS_METHOD = '%s#%s' % (CC_MODULE_CLASS, uc.CC_METHOD_NAME)
62 uc.MODULE2_NAME,
64 uc.CLASS_BUILD_TARGETS,
65 data={constants.TI_FILTER: frozenset([uc.CLASS_FILTER]),
66 constants.TI_REL_CONFIG: uc.CONFIG2_FILE})
68 uc.CC_MODULE2_NAME,
70 uc.CLASS_BUILD_TARGETS,
71 data={constants.TI_FILTER: frozenset([uc.CC_CLASS_FILTER]),
72 constants.TI_REL_CONFIG: uc.CC_CONFIG2_FILE})
90 if search_dir == uc.ROOT:
91 return uc.FIND_ONE
104 self.mod_finder.root_dir = uc.ROOT
119 return_value=uc.MODULE_BUILD_TARGETS)
125 'path': [uc.MODULE_DIR],
129 t_infos = self.mod_finder.find_test_by_module_name(uc.MODULE_NAME)
133 uc.MODULE_INFO)
143 @mock.patch('subprocess.check_output', return_value=uc.FIND_ONE)
145 return_value=uc.FULL_CLASS_NAME)
153 mock_build.return_value = uc.CLASS_BUILD_TARGETS
157 self.mod_finder.module_info.get_module_names.return_value = [uc.MODULE_NAME]
160 constants.MODULE_NAME: uc.MODULE_NAME,
163 t_infos = self.mod_finder.find_test_by_class_name(uc.CLASS_NAME)
165 self, t_infos[0], uc.CLASS_INFO)
168 mock_build.return_value = uc.MODULE_BUILD_TARGETS
169 class_with_method = '%s#%s' % (uc.CLASS_NAME, uc.METHOD_NAME)
172 self, t_infos[0], uc.METHOD_INFO)
173 mock_build.return_value = uc.MODULE_BUILD_TARGETS
174 class_methods = '%s,%s' % (class_with_method, uc.METHOD2_NAME)
180 mock_build.return_value = uc.CLASS_BUILD_TARGETS
182 uc.CLASS_NAME, uc.MODULE_NAME, uc.CONFIG_FILE)
184 self, t_infos[0], uc.CLASS_INFO)
190 t_infos = self.mod_finder.find_test_by_class_name(uc.CLASS_NAME,
191 uc.MODULE2_NAME,
192 uc.CONFIG2_FILE)
202 @mock.patch('subprocess.check_output', return_value=uc.FIND_ONE)
204 return_value=uc.FULL_CLASS_NAME)
216 mock_build.return_value = uc.CLASS_BUILD_TARGETS
218 constants.MODULE_PATH: [uc.MODULE_DIR],
223 unittest_utils.assert_equal_testinfos(self, t_infos[0], uc.CLASS_INFO)
225 mock_build.return_value = uc.MODULE_BUILD_TARGETS
227 unittest_utils.assert_equal_testinfos(self, t_infos[0], uc.METHOD_INFO)
230 bad_module = '%s:%s' % ('BadMod', uc.CLASS_NAME)
235 bad_class = '%s:%s' % (uc.MODULE_NAME, 'Anything')
244 @mock.patch('subprocess.check_output', return_value=uc.FIND_CC_ONE)
258 mock_build.return_value = uc.CLASS_BUILD_TARGETS
260 constants.MODULE_PATH: [uc.CC_MODULE_DIR],
265 unittest_utils.assert_equal_testinfos(self, t_infos[0], uc.CC_MODULE_CLASS_INFO)
267 mock_build.return_value = uc.MODULE_BUILD_TARGETS
270 unittest_utils.assert_equal_testinfos(self, t_infos[0], uc.CC_METHOD_INFO)
272 bad_module = '%s:%s' % ('BadMod', uc.CC_CLASS_NAME)
282 @mock.patch('subprocess.check_output', return_value=uc.FIND_CC_ONE)
296 mock_build.return_value = uc.CLASS_BUILD_TARGETS
298 constants.MODULE_PATH: [uc.CC_MODULE_DIR],
308 @mock.patch('subprocess.check_output', return_value=uc.FIND_PKG)
318 mock_build.return_value = uc.CLASS_BUILD_TARGETS
319 self.mod_finder.module_info.get_module_names.return_value = [uc.MODULE_NAME]
322 constants.MODULE_NAME: uc.MODULE_NAME,
326 t_infos = self.mod_finder.find_test_by_package_name(uc.PACKAGE)
329 uc.PACKAGE_INFO)
331 pkg_with_method = '%s#%s' % (uc.PACKAGE, uc.METHOD_NAME)
337 uc.PACKAGE, uc.MODULE_NAME, uc.CONFIG_FILE)
339 self, t_infos[0], uc.PACKAGE_INFO)
348 @mock.patch('subprocess.check_output', return_value=uc.FIND_PKG)
357 mock_build.return_value = uc.CLASS_BUILD_TARGETS
359 constants.MODULE_PATH: [uc.MODULE_DIR],
367 unittest_utils.assert_equal_testinfos(self, t_infos[0], uc.PACKAGE_INFO)
370 module_pkg_with_method = '%s:%s#%s' % (uc.MODULE2_NAME, uc.PACKAGE,
371 uc.METHOD_NAME)
377 bad_module = '%s:%s' % ('BadMod', uc.PACKAGE)
382 bad_pkg = '%s:%s' % (uc.MODULE_NAME, 'Anything')
394 return_value=uc.FULL_CLASS_NAME)
416 self.mod_finder.module_info.get_module_names.return_value = [uc.MODULE_NAME]
419 constants.MODULE_NAME: uc.MODULE_NAME,
424 mock_dir.return_value = uc.MODULE_DIR
426 class_path = '%s.kt' % uc.CLASS_NAME
427 mock_build.return_value = uc.CLASS_BUILD_TARGETS
430 self, uc.CLASS_INFO, t_infos[0])
432 class_path = '%s.java' % uc.CLASS_NAME
433 mock_build.return_value = uc.CLASS_BUILD_TARGETS
436 self, uc.CLASS_INFO, t_infos[0])
438 class_with_method = '%s#%s' % (class_path, uc.METHOD_NAME)
439 mock_build.return_value = uc.MODULE_BUILD_TARGETS
442 self, t_infos[0], uc.METHOD_INFO)
444 class_with_methods = '%s,%s' % (class_with_method, uc.METHOD2_NAME)
445 mock_build.return_value = uc.MODULE_BUILD_TARGETS
452 self.mod_finder.module_info.get_module_names.return_value = [uc.CC_MODULE_NAME]
455 constants.MODULE_NAME: uc.CC_MODULE_NAME,
458 mock_dir.return_value = uc.CC_MODULE_DIR
459 class_path = '%s' % uc.CC_PATH
460 mock_build.return_value = uc.CLASS_BUILD_TARGETS
463 self, uc.CC_PATH_INFO2, t_infos[0])
466 return_value=uc.MODULE_BUILD_TARGETS)
470 return_value=os.path.relpath(uc.TEST_DATA_DIR, uc.ROOT))
478 class_dir = os.path.join(uc.TEST_DATA_DIR, 'path_testing')
479 self.mod_finder.module_info.get_module_names.return_value = [uc.MODULE_NAME]
482 constants.MODULE_NAME: uc.MODULE_NAME,
487 self, uc.PATH_INFO, t_infos[0])
489 empty_dir = os.path.join(uc.TEST_DATA_DIR, 'path_testing_empty')
492 self, uc.EMPTY_PATH_INFO,
495 class_dir = os.path.join(uc.TEST_DATA_DIR, 'cc_path_testing')
496 self.mod_finder.module_info.get_module_names.return_value = [uc.CC_MODULE_NAME]
499 constants.MODULE_NAME: uc.CC_MODULE_NAME,
504 self, uc.CC_PATH_INFO, t_infos[0])
511 @mock.patch('subprocess.check_output', return_value=uc.CC_FIND_ONE)
519 mock_build.return_value = uc.CLASS_BUILD_TARGETS
523 self.mod_finder.module_info.get_module_names.return_value = [uc.CC_MODULE_NAME]
526 constants.MODULE_NAME: uc.CC_MODULE_NAME,
529 t_infos = self.mod_finder.find_test_by_cc_class_name(uc.CC_CLASS_NAME)
531 self, t_infos[0], uc.CC_CLASS_INFO)
534 mock_build.return_value = uc.MODULE_BUILD_TARGETS
535 class_with_method = '%s#%s' % (uc.CC_CLASS_NAME, uc.CC_METHOD_NAME)
540 uc.CC_METHOD_INFO)
541 mock_build.return_value = uc.MODULE_BUILD_TARGETS
542 class_methods = '%s,%s' % (class_with_method, uc.CC_METHOD2_NAME)
546 uc.CC_METHOD2_INFO)
548 mock_build.return_value = uc.CLASS_BUILD_TARGETS
550 uc.CC_CLASS_NAME, uc.CC_MODULE_NAME, uc.CC_CONFIG_FILE)
552 self, t_infos[0], uc.CC_CLASS_INFO)
558 mock_checkoutput.return_value = uc.CC_FIND_ONE
560 uc.CC_CLASS_NAME,
561 uc.CC_MODULE2_NAME,
562 uc.CC_CONFIG2_FILE)
570 uc.MODULE_NAME, uc.MODULE2_NAME]
572 ld1 = self.mod_finder.get_testable_modules_with_ld(uc.TYPO_MODULE_NAME)
573 self.assertEqual([[16, uc.MODULE2_NAME], [1, uc.MODULE_NAME]], ld1)
575 ld2 = self.mod_finder.get_testable_modules_with_ld(uc.TYPO_MODULE_NAME, 2)
576 self.assertEqual([[1, uc.MODULE_NAME]], ld2)
581 uc.MODULE_NAME, uc.MODULE2_NAME]
582 result = self.mod_finder.get_fuzzy_searching_results(uc.TYPO_MODULE_NAME)
583 self.assertEqual(uc.MODULE_NAME, result[0])