forked from OdonataResearchLLC/lisp-unit
-
Notifications
You must be signed in to change notification settings - Fork 6
/
vars.lisp
52 lines (41 loc) · 1.89 KB
/
vars.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(in-package :lisp-unit2)
(cl-interpol:enable-interpol-syntax)
(defvar *test-stream* (make-synonym-stream '*standard-output*))
(defvar *test-log-stream* *test-stream*)
(defvar *unit-test* nil
"The currently executing unit test (bound in %run-test, ie every test
function)" )
(defvar *results* nil "The current results database (bound in run-tests)")
(defvar *result* nil "The current test result (bound in %run-test)")
(defparameter *log-level* 5)
(defvar *test-db* nil
"The unit test database is a list of tests and some hashtable indexes")
(defparameter +statuses+
'(errors failed warnings passed missing empty)
"List of statuses in order of priority for categorizing test runs")
;;; Run the tests
(define-condition missing-test (warning)
((test-name :accessor test-name :initarg :test-name :initform nil))
(:documentation "Signaled when a single test is finished.")
(:report
(lambda (c s)
(format s "Warning MISSING-TEST: ~A" (test-name c)))))
(define-condition test-start ()
((unit-test :accessor unit-test :initarg :unit-test :initform nil))
(:documentation "Signaled when a single test starts."))
(define-condition test-complete ()
((result :accessor result :initarg :result :initform nil))
(:documentation
"Signaled when a single test is finished."))
(define-condition all-tests-start ()
((results :accessor results :initarg :results :initform nil))
(:documentation "Signaled when a single test starts."))
(define-condition all-tests-complete ()
((results :accessor results :initarg :results :initform nil)
(name :accessor name :initarg :name :initform nil
:documentation "Name for this test results"))
(:documentation
"Signaled when a test run is finished."))
(define-condition collect-test-results ()
((results :accessor results :initarg :results :initform nil))
(:documentation "Signaled that with-test-results should collect this test-result-database"))