Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lcov_cobertura/lcov_cobertura.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,14 @@ def parse(self, **kwargs):
elif input_type == 'FN':
# FN:5,(anonymous_1)
function_line, function_name = line_parts[-1].strip().split(',', 1)
file_methods[function_name] = [function_line, '0']
file_methods[self.format(function_name)] = [function_line, '0']
elif input_type == 'FNDA':
# FNDA:0,(anonymous_1)
(function_hits, function_name) = line_parts[-1].strip().split(',', 1)
if function_name not in file_methods:
file_methods[function_name] = ['0', '0']
file_methods[function_name][-1] = function_hits
demangled_fn_name = self.format(function_name)
if demangled_fn_name not in file_methods:
file_methods[demangled_fn_name] = ['0', '0']
file_methods[demangled_fn_name][-1] += function_hits

# Exclude packages
excluded = [x for x in coverage_data['packages'] for e in self.excludes
Expand Down Expand Up @@ -291,7 +292,7 @@ def generate_cobertura_xml(self, coverage_data, **kwargs):
methods_el = self._el(document, 'methods', {})
for method_name, (line, hits) in list(class_data['methods'].items()):
method_el = self._el(document, 'method', {
'name': self.format(method_name),
'name': method_name,
'signature': '',
'line-rate': '1.0' if int(hits) > 0 else '0.0',
'branch-rate': '1.0' if int(hits) > 0 else '0.0',
Expand Down