From 4735b3e8df032db8e1d1535f759cab9d9ea8f978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 8 Apr 2025 07:14:56 +0000 Subject: [PATCH 1/5] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD?= =?UTF-8?q?=E8=BE=89=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 7 +++++++ src/core/driver/drivers.py | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index 5ff82ed..d8b4d8d 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -260,6 +260,13 @@ class Console(object): help="Specify part deps", choices=["partdeps"] ) + parser.add_argument("-hg", "--hilog", + action="store", + type=str, + dest="hilog", + default=False, + help="The console does not print operation hilog logs" + ) # 解析部分命令行参数,会返回一个由两个条目构成的元组,其中包含带成员的命名空间(options)和剩余参数字符串的列表(unparsed) cls._params_pre_processing(para_list) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 80f00da..936e834 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -577,8 +577,10 @@ class CppTestDriver(IDriver): result.make_empty_result_file( "No test device is found. ") return + self.config.device.set_device_report_path(request.config.report_path) - self.config.device.device_log_collector.start_hilog_task() + if not request.config.hilog: + self.config.device.device_log_collector.start_hilog_task() self._init_gtest() self._run_gtest(suite_file) @@ -592,8 +594,9 @@ class CppTestDriver(IDriver): log_tar_file_name = "{}_{}".format(request.get_module_name(), str(serial).replace( ":", "_")) try: - self.config.device.device_log_collector.stop_hilog_task( - log_tar_file_name, module_name=request.get_module_name()) + if not request.config.hilog: + self.config.device.device_log_collector.stop_hilog_task( + log_tar_file_name, module_name=request.get_module_name()) finally: update_xml(request.root.source.source_file, xml_path) -- Gitee From 5dd7758b10ebf89821314c15a13982fa459cf532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 8 Apr 2025 07:58:41 +0000 Subject: [PATCH 2/5] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD?= =?UTF-8?q?=E8=BE=89=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 2 +- src/core/driver/drivers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index d8b4d8d..293fd9e 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -264,7 +264,7 @@ class Console(object): action="store", type=str, dest="hilog", - default=False, + default=True, help="The console does not print operation hilog logs" ) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 936e834..164fa08 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -579,7 +579,7 @@ class CppTestDriver(IDriver): return self.config.device.set_device_report_path(request.config.report_path) - if not request.config.hilog: + if request.config.hilog: self.config.device.device_log_collector.start_hilog_task() self._init_gtest() self._run_gtest(suite_file) @@ -594,7 +594,7 @@ class CppTestDriver(IDriver): log_tar_file_name = "{}_{}".format(request.get_module_name(), str(serial).replace( ":", "_")) try: - if not request.config.hilog: + if request.config.hilog: self.config.device.device_log_collector.stop_hilog_task( log_tar_file_name, module_name=request.get_module_name()) finally: -- Gitee From 0cf91aad8d311e971cb861b6af97a2867bffda75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 8 Apr 2025 08:09:24 +0000 Subject: [PATCH 3/5] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD?= =?UTF-8?q?=E8=BE=89=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index 293fd9e..4674186 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -260,7 +260,7 @@ class Console(object): help="Specify part deps", choices=["partdeps"] ) - parser.add_argument("-hg", "--hilog", + parser.add_argument("-hg", "--hilogswitch", action="store", type=str, dest="hilog", -- Gitee From 27a23f1d63692241775533c0ec64d7052d2b0643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 8 Apr 2025 08:12:04 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD?= =?UTF-8?q?=E8=BE=89=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/driver/drivers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 164fa08..acead21 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -579,7 +579,7 @@ class CppTestDriver(IDriver): return self.config.device.set_device_report_path(request.config.report_path) - if request.config.hilog: + if request.config.hilogswitch: self.config.device.device_log_collector.start_hilog_task() self._init_gtest() self._run_gtest(suite_file) @@ -594,7 +594,7 @@ class CppTestDriver(IDriver): log_tar_file_name = "{}_{}".format(request.get_module_name(), str(serial).replace( ":", "_")) try: - if request.config.hilog: + if request.config.hilogswitch: self.config.device.device_log_collector.stop_hilog_task( log_tar_file_name, module_name=request.get_module_name()) finally: -- Gitee From 6ef657efd74573f75fb0c35e5327dab837db75d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 8 Apr 2025 08:33:09 +0000 Subject: [PATCH 5/5] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD?= =?UTF-8?q?=E8=BE=89=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 2 +- src/core/driver/drivers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index 4674186..2aa8739 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -263,7 +263,7 @@ class Console(object): parser.add_argument("-hg", "--hilogswitch", action="store", type=str, - dest="hilog", + dest="hilogswitch", default=True, help="The console does not print operation hilog logs" ) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index acead21..b27bf6e 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -579,7 +579,7 @@ class CppTestDriver(IDriver): return self.config.device.set_device_report_path(request.config.report_path) - if request.config.hilogswitch: + if request.config.hilogswitch != "0": self.config.device.device_log_collector.start_hilog_task() self._init_gtest() self._run_gtest(suite_file) @@ -594,7 +594,7 @@ class CppTestDriver(IDriver): log_tar_file_name = "{}_{}".format(request.get_module_name(), str(serial).replace( ":", "_")) try: - if request.config.hilogswitch: + if request.config.hilogswitch != "0": self.config.device.device_log_collector.stop_hilog_task( log_tar_file_name, module_name=request.get_module_name()) finally: -- Gitee