From f10bf317d6d28491bd4e5e21a7b5776703481b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 9 Jul 2024 01:58:47 +0000 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD=E8=BE=89=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- .../interface_coverage_gcov_lcov.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py b/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py index e3f0b4d..708c776 100644 --- a/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py +++ b/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py @@ -228,19 +228,20 @@ def get_covered_function_list(part_name): return covered_function_list with open(file_path, "r") as fd: - pass + for line in fd: + if not line.startswith("FNDA:"): + continue - for line in fd: - if not line.startswith("FNDA:"): - continue + sub_line_string = line[len("FNDA:"):].replace("\n", "").strip() + temp_list = sub_line_string.split(",") + if len(temp_list) != 2 or int(temp_list[0]) == 0: + continue - sub_line_string = line[len("FNDA:"):].replace("\n", "").strip() - temp_list = sub_line_string.split(",") - if len(temp_list) == 2 and int(temp_list[0]) != 0: func_info = get_function_info_string(temp_list[1]) after_func_info = func_info.decode("utf-8") if "" == after_func_info: continue + after_func_info = after_func_info.replace("\n", "") if after_func_info == temp_list[1] and after_func_info.startswith("_"): continue -- Gitee