summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-01-16 15:17:37 (GMT)
committerIlia Alshanetsky <iliaa@php.net>2004-01-16 15:17:37 (GMT)
commita0664d54d16216cbd406961c5bb89e831bf39808 (patch)
tree66a5e0cc2125f76bc427bcd0fd181deedcf91196 /run-tests.php
parent1d86ea88516c88ecfbf314b0f39f76452d04342a (diff)
downloadphp-a0664d54d16216cbd406961c5bb89e831bf39808.tar.gz
Fixed division by zero warning.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/run-tests.php b/run-tests.php
index 96e52ec..e4dfad4 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1112,9 +1112,13 @@ function get_summary($show_ext_summary)
global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS;
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
- $x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
- $x_failed = (100.0 * $sum_results['FAILED']) / $x_total;
- $x_passed = (100.0 * $sum_results['PASSED']) / $x_total;
+ if ($x_total) {
+ $x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
+ $x_failed = (100.0 * $sum_results['FAILED']) / $x_total;
+ $x_passed = (100.0 * $sum_results['PASSED']) / $x_total;
+ } else {
+ $x_warned = $x_failed = $x_passed = 0;
+ }
$summary = "";
if ($show_ext_summary) {