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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2019-01-25 09:26:39 -05:00
parent 47cf4bf544
commit a34f371e36
1 changed files with 5 additions and 1 deletions

6
scripts/gen_gcov_files.py Normal file → Executable file
View File

@ -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):