Skip to content

Commit 6a51bc4

Browse files
authored
Merge pull request #1573 from frasercrmck/fix-div-by-zero
[CTS] Avoid division by zero (when there are no results)
2 parents f3fb858 + 01ce679 commit 6a51bc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/ctest_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_cts_test_suite_names(working_directory):
2424
]
2525

2626
def percent(amount, total):
27-
return round((amount / total) * 100, 2)
27+
return round((amount / (total or 1)) * 100, 2)
2828

2929
def summarize_results(results):
3030
total = results['Total']

0 commit comments

Comments
 (0)