From: Ryan Davis Date: Tue, 5 Feb 2013 14:54:01 +0000 (-0500) Subject: record the run time of the test X-Git-Tag: 0.9.4~1^2~1^2~1 X-Git-Url: https://repo.or.cz/w/lisp-unit.git/commitdiff_plain/844139de6b4ced1d12c3939fbfdf0e89bc9e65e1 record the run time of the test --- diff --git a/lisp-unit.lisp b/lisp-unit.lisp index 58db3b8..45c1116 100644 --- a/lisp-unit.lisp +++ b/lisp-unit.lisp @@ -516,7 +516,10 @@ assertion.") :reader fail) (exerr :initarg :exerr - :reader exerr)) + :reader exerr) + (run-time :initarg :run-time + :reader run-time + :documentation "run time measured in internal time units")) (:default-initargs :exerr nil) (:documentation "Store the results of the unit test.")) @@ -540,7 +543,8 @@ assertion.") (defun run-test-thunk (name code) (let ((*pass* 0) - (*fail* ())) + (*fail* ()) + (start (get-internal-run-time))) (handler-bind ((error (lambda (condition) @@ -552,6 +556,7 @@ assertion.") :name name :pass *pass* :fail *fail* + :run-time (- (get-internal-run-time) start) :exerr condition)))))) (run-code code)) ;; Return the result count @@ -559,7 +564,8 @@ assertion.") 'test-result :name name :pass *pass* - :fail *fail*))) + :fail *fail* + :run-time (- (get-internal-run-time) start)))) ;;; Test results database