diff --git a/src/core/command/console.py b/src/core/command/console.py index 7ae9ff5922fb3c9b9ac7213ee8af89ee15ec148f..14bba2eccfa8ab5c44488bc04797199659e0b6d0 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -389,6 +389,7 @@ class Console(object): product_form) return build_result + @dataclass class ConfigConst(object): action = "action" @@ -431,5 +432,6 @@ class ConfigConst(object): component_base_kit = "component_base_kit" support_component = "support_component" + ############################################################################## ############################################################################## diff --git a/src/core/command/run.py b/src/core/command/run.py index 56fc47d28d4df098dd00cd8373b4458e18296477..ba3d8c4e66d6f98887813a9dd3f53d0eb1e582bc 100755 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -159,6 +159,8 @@ class Run(object): DeviceTestType.ctest_lite) else: print("productform is not wifiiot") + options.testcases_path = self.get_acts_tests_out_path(options.productform) + options.resource_path = self.get_acts_tests_out_path(options.productform) scheduler.exec_command(command, options) return diff --git a/src/core/testcase/testcase_manager.py b/src/core/testcase/testcase_manager.py index 656924549055bfdf42d4d44643c9c493ad2248e1..1cbe0966d8b109f861a25193dc4a43f356bdb989 100755 --- a/src/core/testcase/testcase_manager.py +++ b/src/core/testcase/testcase_manager.py @@ -36,6 +36,7 @@ TESTFILE_TYPE_DATA_DIC = { "PYT": [], "CXX": [], "BIN": [], + "OHJST": [], "JST": [], } FILTER_SUFFIX_NAME_LIST = [".TOC", ".info", ".pyc"] @@ -150,9 +151,18 @@ class TestCaseManager(object): continue if not self.check_hap_test_file(acts_suite_file): continue - acts_suit_file_dic["JST"].append(acts_suite_file) + if not self.get_hap_test_driver(acts_suite_file): + continue + if self.get_hap_test_driver(acts_suite_file) == "OHJSUnitTest": + acts_suit_file_dic["OHJST"].append(acts_suite_file) + print(" acts_suit_file_dic['OHJST'] :%s" % acts_suit_file_dic["OHJST"]) + if self.get_hap_test_driver(acts_suite_file) == "JSUnitTest": + acts_suit_file_dic["JST"].append(acts_suite_file) + else: LOG.error("acts %s is not exist." % acts_test_case_path) + + print(" acts_suit_file_dic :%s" % acts_suit_file_dic) return acts_suit_file_dic @classmethod @@ -229,6 +239,28 @@ class TestCaseManager(object): finally: print(" check hap test file finally") + @classmethod + def get_hap_test_driver(cls, hap_file_path): + if hap_file_path.endswith(".hap"): + json_file_path = hap_file_path.replace(".hap", ".json") + if os.path.exists(json_file_path): + with open(json_file_path, 'r') as json_file: + data_dic = json.load(json_file) + if not data_dic: + return False + else: + if "driver" in data_dic.keys(): + driver_dict = data_dic.get("driver") + if bool(driver_dict): + driver_type = driver_dict.get("type") + return driver_type + else: + LOG.error("%s has not set driver." % hap_file_path) + else: + return False + else: + return False + @classmethod def get_part_name_test_file(cls, hap_file_path): if hap_file_path.endswith(".hap"):