chiark / gitweb /
Work in progress, recovered from old crybaby.
[sod] / src / test-base.lisp
index 6e020cba09339aaf30ed8edbe4c6780d934c1d9d..ffc8e19a936fd8bfbbf63738f20220c290080128 100644 (file)
@@ -52,7 +52,23 @@ (defun assert-princ (object string)
                               rather than `~A'."
                          object print string))))
 
-(defun run-tests ()
-  (textui-test-run *sod-test-suite*))
+(defun run-tests (&optional which)
+  (textui-test-run (acond
+                    ((null which) *sod-test-suite*)
+                    ((labels ((dredge (suite)
+                                (cond
+                                  ((typep suite 'test-suite)
+                                   (some #'dredge (tests suite)))
+                                  ((eq (xlunit::name suite) which)
+                                   suite)
+                                  (t
+                                   nil))))
+                       (dredge *sod-test-suite*))
+                     it)
+                    ((find-class which nil)
+                     (suite (make-instance it)))
+                    (t
+                     (error "Don't know how to turn ~S into a test suite"
+                            which)))))
 
 ;;;----- That's all, folks --------------------------------------------------