Skip to content

Commit 01ce679

Browse files
committed
[CTS] Avoid division by zero (when there are no results)
When trying to run the CTS from a directory with no tests then the total number of tests is 0, which was causing issues when summarizing results.
1 parent f3fb858 commit 01ce679

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)