Skip to content

Commit

Permalink
Merge pull request #39 from cxxxr/change-to-method
Browse files Browse the repository at this point in the history
change to method
  • Loading branch information
fukamachi authored Feb 25, 2020
2 parents b8f12e6 + bf252ce commit bbc7b8e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,21 @@
(loop for (,k . ,v) in ,before-env
do (setf (uiop:getenv ,k) ,v))))))

(defun run-test (test-name &key (style :spec))
"Run a single test function."
(defgeneric run-test (test-name &key style)
(:documentation "Run a single test function."))

(defgeneric run (target &key style env)
(:documentation "Run a test package."))

(defmethod run-test (test-name &key (style :spec))
(let ((test (get-test test-name)))
(unless test
(error "No test found for ~S" test-name))
(with-reporter style
(testing nil
(funcall test)))))
(funcall test)))))

(defun run (target &key (style *default-reporter*) (env *default-env*))
"Run a test package."
(defmethod run (target &key (style *default-reporter*) (env *default-env*))
(with-local-envs env
(with-reporter style
(run-system-tests target))))
Expand Down

0 comments on commit bbc7b8e

Please sign in to comment.