-
-(defmethod print-errors ((ob textui-test-runner) result)
- (let ((errors (errors result)))
- (when errors
- (if (eql (length errors) 1)
- (format (ostream ob) "~%There was 1 error:~%")
- (format (ostream ob) "~%There were ~a errors:~%" (length errors)))
- (let ((i 1))
- (mapc #'(lambda (single-error)
- (format (ostream ob) "~a) ~a: ~a~%" i
- (name (car single-error)) (cdr single-error))
- (incf i))
- errors)))))
-
-(defmethod print-failures ((ob textui-test-runner) result)
- (let ((failures (failures result)))
- (when failures
- (if (eql (length failures) 1)
- (format (ostream ob) "~%There was 1 failure:~%")
- (format (ostream ob) "~%There were ~a failures:~%" (length failures)))
- (let ((i 1))
- (mapc #'(lambda (single-failure)
- (format (ostream ob) "~a) ~a: ~a~%" i (name (car single-failure))
- (or (message (cdr single-failure)) ""))
- (incf i))
- failures)))))
-
-#|
-(defun result-printer (result seconds stream)
- (format stream "~&Time: ~D~%~%" (coerce seconds 'float))
- (print-defects (errors result) "error" stream)
- (print-defects (failures result) "failure" stream)
- (if (was-successful result)
- (format stream "OK (~D tests)~%" (run-count result))
- (progn
- (format stream "~%FAILURES!!!~%")
- (format stream "Tests run: ~D, Failures: ~D, Errors: ~D~%"
- (run-count result) (failure-count result)
- (error-count result)))))
-
-(defun print-defects (defects type stream)
- (when defects
- (let ((count (length defects)))
- (if (= count 1)
- (format stream "~&There was ~D ~A:~%" count type)
- (format stream "~&There were ~D ~As:~%" count type))
- (dotimes (i count)
- (let ((defect (nth i defects)))
- (format stream "~&~D) ~A " i (class-name
- (class-of (failed-test defect))))
- (apply #'format stream (simple-condition-format-control
- (thrown-condition defect))
- (simple-condition-format-arguments
- (thrown-condition defect)))
- (fresh-line stream))))))
-
-|#