1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; ID: $Id: textui.lisp,v 1.3 2003/08/10 07:39:33 kevin Exp $
6 ;;;; Purpose: Text UI for Test Runner
8 ;;;; *************************************************************************
14 (defclass textui-test-runner (test-listener)
15 ((ostream :initform nil :accessor ostream :initarg :ostream))
16 (:default-initargs :ostream *standard-output*))
18 (defmethod add-error ((ob textui-test-runner) test-case condition)
19 (declare (ignore test-case condition))
20 (format (ostream ob) "E"))
22 (defmethod add-failure ((ob textui-test-runner) test-case condition)
23 (declare (ignore test-case condition))
24 (format (ostream ob) "F"))
26 (defmethod start-test ((ob textui-test-runner) test-case)
27 (declare (ignore test-case))
28 (format (ostream ob) "."))
31 (defmethod textui-test-run ((ob test))
32 (let ((test-runner (make-instance 'textui-test-runner))
33 (result (make-instance 'test-results))
34 (start-time (get-internal-real-time)))
35 (add-listener result test-runner)
36 (run-on-test-results ob result)
37 (print-results test-runner result
38 (/ (- (get-internal-real-time) start-time)
39 internal-time-units-per-second))