
Carl Shapiro pushed to branch master at cmucl / cmucl Commits: 5b27393f by Carl Shapiro at 2023-07-30T21:15:48-07:00 Guard against a division by zero in test run reports - - - - - a7300f03 by Carl Shapiro at 2023-07-31T05:28:58+00:00 Merge branch 'zero-tests' into 'master' Guard against a division by zero when reporting test results See merge request cmucl/cmucl!161 - - - - - 1 changed file: - tests/run-tests.lisp Changes: ===================================== tests/run-tests.lisp ===================================== @@ -110,9 +110,10 @@ (format t " ~5D tests failed~%" failed) (format t " ~5D tests with execution errors~%" execute-errors) (format t "~5,3f% of the tests passed~%" - (float (* 100 - (- 1 (/ (+ failed execute-errors) - (+ passed failed execute-errors)))))) + (let ((total (+ passed failed execute-errors))) + (if (zerop total) + 0.0 + (* 100.0 (- 1.0 (/ (- total passed) total)))))) ;; Print some info about any failed tests. Then exit. We want to ;; set the exit code so that any scripts runnning this can ;; determine if there were any test failures. View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/24152f4d49b7226075dd52f... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/24152f4d49b7226075dd52f... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Carl Shapiro (@cshapiro)