Skip to content

Commit

Permalink
Check if coverage is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
nbelliot committed Mar 18, 2020
1 parent 76d7663 commit a96b521
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/resources/scripts/generate_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def add_coverage(self, is_unit, unit_or_func, metrics, cov_type):

if self.verbose:
print "Coverage Type:", cov_type


if cov_type == None:
return entry

if "MC/DC" in cov_type:
entry["branch"] = self.calc_cov_values(metrics.max_covered_mcdc_branches, metrics.mcdc_branches)
if not self.simplified_mcdc:
Expand Down Expand Up @@ -123,7 +126,9 @@ def grand_total_coverage(self, cov_type):
if self.has_function_coverage:
entry["function"] = self.calc_cov_values(self.grand_total_max_covered_functions, self.grand_total_max_coverable_functions)
if self.has_call_coverage:
entry["functioncall"] = self.calc_cov_values(self.grand_total_max_covered_function_calls, self.grand_total_function_calls)
entry["functioncall"] = self.calc_cov_values(self.grand_total_max_covered_function_calls, self.grand_total_function_calls)
if cov_type == None:
return entry
if "MC/DC" in cov_type:
entry["branch"] = self.calc_cov_values(self.grand_total_max_mcdc_covered_branches, self.grand_total_mcdc_branches)
if not self.simplified_mcdc:
Expand Down

0 comments on commit a96b521

Please sign in to comment.