X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fclasses.lisp;h=cc0a21ddc1ef3a0ae8d42cd1a8a8bc147536516f;hb=refs%2Fheads%2Fdev;hp=fc4dc782e8cb45397557dcf6e51ecf24b7c534c6;hpb=869a1f5516006aba36b927d447206f686206fbc1;p=fiveam.git diff --git a/src/classes.lisp b/src/classes.lisp index fc4dc78..cc0a21d 100644 --- a/src/classes.lisp +++ b/src/classes.lisp @@ -11,11 +11,11 @@ :documentation "The list of AND, OR, NOT forms specifying when to run this test.") (status :initarg :status :accessor status :initform :unknown :documentation "A symbol specifying the current status - of this test. Either: T - this test (and all its - dependencies, have passed. NIL - this test - failed (either it failed or its dependecies weren't - met. :circular this test has a circular dependency - and was skipped. Or :depends-not-satisfied or :resolving") + of this test. Either: T - this test (and all its + dependencies, have passed. NIL - this test + failed (either it failed or its dependecies weren't + met. :circular this test has a circular dependency + and was skipped. Or :depends-not-satisfied or :resolving") (profiling-info :accessor profiling-info :initform nil :documentation "An object representing how @@ -28,6 +28,10 @@ information will be collected when the test is run."))) +(defgeneric testable-object-p (object) + (:method ((object testable-object)) t) + (:method ((object t)) nil)) + (defmethod print-object ((test testable-object) stream) (print-unreadable-object (test stream :type t :identity t) (format stream "~S" (name test)))) @@ -35,8 +39,11 @@ (defclass test-suite (testable-object) ((tests :accessor tests :initform (make-hash-table :test 'eql) :documentation "The hash table mapping names to test - objects in this suite. The values in this hash table - can be either test-cases or other test-suites.")) + objects in this suite. The values in this hash table + can be either test-cases or other test-suites.") + (fixture :accessor fixture :initform nil :initarg :fixture + :documentation "FIXTURE to use, by default, for tests in + this suite.")) (:documentation "A test suite is a collection of tests or test suites. Test suites serve to organize tests into groups so that the @@ -54,7 +61,9 @@ suite) in the suite.")) ((test-lambda :initarg :test-lambda :accessor test-lambda :documentation "The function to run.") (runtime-package :initarg :runtime-package :accessor runtime-package - :documentation "By default it stores *package* from the time this test was defined (macroexpanded).")) + :documentation "By default it stores *package* + from the time this test was + defined (macroexpanded).")) (:documentation "A test case is a single, named, collection of checks.