From a34f371e363780d92b9e87dc67706ee25201b174 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 25 Jan 2019 09:26:39 -0500 Subject: [PATCH] scripts: gen_gcov_files: report if data capture is not complete If we get incomplete data, report on the screen. Signed-off-by: Anas Nashif --- scripts/gen_gcov_files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/gen_gcov_files.py diff --git a/scripts/gen_gcov_files.py b/scripts/gen_gcov_files.py old mode 100644 new mode 100755 index 85d60e1cd56..317dc1d6759 --- a/scripts/gen_gcov_files.py +++ b/scripts/gen_gcov_files.py @@ -16,13 +16,14 @@ import re def retrieve_data(input_file): extracted_coverage_info = {} capture_data = False + reached_end = False with open(input_file, 'r') as fp: for line in fp.readlines(): if re.search("GCOV_COVERAGE_DUMP_START", line): capture_data = True continue if re.search("GCOV_COVERAGE_DUMP_END", line): - capture_data = True + reached_end = True break # Loop until the coverage data is found. if not capture_data: @@ -33,6 +34,9 @@ def retrieve_data(input_file): # Remove the trailing new line char hex_dump = line.split("<")[1][:-1] extracted_coverage_info.update({file_name:hex_dump}) + + if not reached_end: + print("incomplete data captured from %s" %input_file) return extracted_coverage_info def create_gcda_files(extracted_coverage_info):