From 2f4b13fbe88d004857892e3bf23f3cb13d3d75a2 Mon Sep 17 00:00:00 2001 From: wanggang Date: Wed, 29 Jun 2022 17:48:33 +0800 Subject: [PATCH] =?UTF-8?q?acts=E7=BC=96=E8=AF=91=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E6=9C=AA=E6=8C=87=E5=AE=9A=E5=AD=90=E7=B3=BB=E7=BB=9F=E4=BE=BF?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=B5=8B=E8=AF=95=E5=A5=97=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanggang --- src/core/build/build_manager.py | 1 + src/core/build/build_testcases.py | 5 ++++- src/core/command/display.py | 35 ++++++++++++++++++++++--------- src/core/command/run.py | 2 -- src/core/driver/drivers.py | 24 +++++++++++++++++++++ 5 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/core/build/build_manager.py b/src/core/build/build_manager.py index dc0c6b4..b0cf72d 100755 --- a/src/core/build/build_manager.py +++ b/src/core/build/build_manager.py @@ -170,6 +170,7 @@ class BuildManager(object): LOG.info("partname_list = %s" % str(param.partname_list)) LOG.info("testmodule = %s" % param.testmodule) LOG.info("testsuit = %s" % param.testsuit) + LOG.info("testcase = %s" % param.testcase) LOG.info("--------------------------------------------------") LOG.info("") diff --git a/src/core/build/build_testcases.py b/src/core/build/build_testcases.py index d3e8730..a71b8f7 100755 --- a/src/core/build/build_testcases.py +++ b/src/core/build/build_testcases.py @@ -209,8 +209,11 @@ class BuildTestcases(object): acts_build_command.append("system_size=standard") if len(para.subsystem) > 0: acts_build_command.append(BUILD_TARGET_SUBSYSTEM % para.subsystem[0]) - if para.testsuit != "": + if para.testsuit != "" and len(para.subsystem) > 0: acts_build_command.append(BUILD_TARGET_SUITE % para.testsuit) + elif para.testsuit != "" and len(para.subsystem) == 0: + LOG.error("Please specify subsystem.") + return if os.path.exists(BUILD_FILEPATH): build_command = [BUILD_FILEPATH] build_command.extend(acts_build_command) diff --git a/src/core/command/display.py b/src/core/command/display.py index e867c0a..99e950e 100755 --- a/src/core/command/display.py +++ b/src/core/command/display.py @@ -45,15 +45,16 @@ CMD_KEY_PRODUCTLIST = "productlist" # 测试用例类型 # 1. UT -# 2. MST -# 3. ST -# 4. PERF -# 5. SEC -# 6. FUZZ -# 7. RELI -# 8. DST -# 9. BENCHMARK -# 10. ALL +# 2. ACTS +# 3. MST +# 4. ST +# 5. PERF +# 6. SEC +# 7. FUZZ +# 8. RELI +# 9. DST +# 10. BENCHMARK +# 11. ALL CMD_KEY_TYPELIST = "typelist" # 子系统名称列表 @@ -62,6 +63,9 @@ CMD_KEY_SUBSYSTEMLIST = "subsystemlist" # 子系统下的部件名 CMD_KEY_PARTLIST = "partlist" +# acts子系统名称列表 +CMD_KEY_SUBSYSTEMLIST_ACTS = "actssubsystemlist" + TOOL_VERSION_INFO = """Welcome to DeveloperTest V1.0.0. """ @@ -264,7 +268,6 @@ def show_product_list(): else: print("No category specified.") - def show_testtype_list(): print("List of currently supported test types:") testtype_list = FrameworkConfigManager().get_framework_config( @@ -287,6 +290,16 @@ def show_subsystem_list(product_form): for index, element in enumerate(subsystem_name_list): print(" %d. %s" % (index + 1, element)) +def show_acts_subsystem_list(): + print("List of currently supported acts subsystem names:") + sub_list = ['global','security','useriam','multimedia','appexecfwk','account','communication','notification', + 'aafwk','miscservices','powermgr','startup','sensor','distributeddatamgr','update','graphic','ace', + 'storage','distributedhardware','compileruntime','usb','multimodalinput','resourceschedule', + 'telephony','hiviewdfx','location','settingsdata','barrierfree','customization'] + sub_list.sort() + for index, element in enumerate(sub_list): + print(" %d. %s" % (index + 1, element.strip())) + # 从OpenHarmony/out/rk3568/build_configs/infos_for_testfwk.json里的subsystem_infos中subsystem_infos下获取partlist def show_partname_list(product_form): print("List of currently supported part names:") @@ -326,6 +339,8 @@ def display_show_command_info(command, product_form="phone"): show_subsystem_list(product_form) elif command == CMD_KEY_PARTLIST: show_partname_list(product_form) + elif command == CMD_KEY_SUBSYSTEMLIST_ACTS: + show_acts_subsystem_list() else: print("This command is not support.") diff --git a/src/core/command/run.py b/src/core/command/run.py index f662c01..4ed923e 100755 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -141,8 +141,6 @@ class Run(object): options.testcases_path = options.target_outpath options.resource_path = os.path.abspath(os.path.join( sys.framework_root_dir, "..", "resource")) - print(options.testcases_path) - print(options.resource_path) if options.productform.find("wifiiot") != -1: scheduler.update_test_type_in_source(".bin", DeviceTestType.ctest_lite) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 791b97f..2b76afd 100755 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -99,6 +99,8 @@ class DisplayOutputReceiver: class GTestConst(object): exec_para_filter = "--gtest_filter" exec_para_level = "--gtest_testsize" + exec_acts_para_filter = "--jstest_filter" + exec_acts_para_level = "--jstest_testsize" def get_device_log_file(report_path, serial=None, log_name="device_log"): @@ -808,6 +810,28 @@ class JSUnitTestDriver(IDriver): _sleep_according_to_result(return_message) return return_message + @staticmethod + def _get_acts_test_para(testcase, + testlevel, + testtype, + target_test_path, + suite_file, + filename): + if "actstest" == testtype[0]: + test_para = (" --actstest_out_format=json" + " --actstest_out=%s%s.json") % ( + target_test_path, filename) + return test_para + + if "" != testcase and "" == testlevel: + test_para = "%s=%s" % (GTestConst.exec_acts_para_filter, testcase) + elif "" == testcase and "" != testlevel: + level_para = get_level_para_string(testlevel) + test_para = "%s=%s" % (GTestConst.exec_acts_para_level, level_para) + else: + test_para = "" + return test_para + @classmethod def _get_json_shell_timeout(cls, json_filepath): test_timeout = 300 -- GitLab