Revert branch identification for now
This commit is contained in:
parent
1c3107e8cc
commit
91fbb3bbbd
@ -27,13 +27,16 @@ class GCovFile:
|
||||
lines: List[GCovLine] = []
|
||||
|
||||
for line in file["lines"]:
|
||||
if len(line["branches"]):
|
||||
# GCov reports branches in reverse order to our parser.
|
||||
branch_number = len(line["branches"])
|
||||
for branch in line["branches"]:
|
||||
lines.append(GCovLine(line["line_number"], branch["count"], branch_number))
|
||||
branch_number -= 1
|
||||
else:
|
||||
lines.append(GCovLine(line["line_number"], line["count"]))
|
||||
|
||||
# Branch specific identification. TODO! later.
|
||||
#if len(line["branches"]):
|
||||
# # GCov reports branches in reverse order to our parser.
|
||||
# branch_number = len(line["branches"])
|
||||
# for branch in line["branches"]:
|
||||
# lines.append(GCovLine(line["line_number"], branch["count"], branch_number))
|
||||
# branch_number -= 1
|
||||
#else:
|
||||
# lines.append(GCovLine(line["line_number"], line["count"])))
|
||||
|
||||
self.files[name] = lines
|
||||
|
||||
@ -17,6 +17,8 @@ class OpSummarizer:
|
||||
|
||||
def count_operations(self, file: str) -> Dict[UniqueOperation, int]:
|
||||
if file not in self.gcov.files or file not in self.ops.files:
|
||||
print(f"Gcov files: {self.gcov.files.keys()}")
|
||||
print(f"Opfinder files: {self.ops.files.keys()}")
|
||||
raise RuntimeError(f"File {file} not in both parsers.")
|
||||
|
||||
op_counter: Dict[UniqueOperation, int] = {}
|
||||
@ -26,8 +28,8 @@ class OpSummarizer:
|
||||
for op_log in op_lines:
|
||||
# TODO: revise this. Need a special case for for-loop clauses
|
||||
# or branching in general.
|
||||
if op_log.branch_number != gcov_line.branch_number:
|
||||
continue
|
||||
#if op_log.branch_number != gcov_line.branch_number:
|
||||
# continue
|
||||
|
||||
unique_op = op_log.entry
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user