From: Olof-Joachim Frahm Date: Thu, 23 Aug 2012 19:13:52 +0000 (+0200) Subject: Implement RUN-ALL-TESTS and friends. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5d83672b8d9cbc7179dcced2e25bc30253c34519;p=fiveam.git Implement RUN-ALL-TESTS and friends. --- diff --git a/src/package.lisp b/src/package.lisp index 4183f11..f6e211b 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -61,9 +61,12 @@ ;; running tests #:run #:run-all-tests + #:run-all-test-suites #:explain #:explain! #:run! + #:run-all-tests! + #:run-all-test-suites! #:debug! #:! #:!! diff --git a/src/run.lisp b/src/run.lisp index 6e5a7ec..15e6ef9 100644 --- a/src/run.lisp +++ b/src/run.lisp @@ -277,6 +277,35 @@ performed by the !, !! and !!! functions." "Rerun the third most recently run test and explain the results." (explain! (funcall *!!!*))) +(defun run-all-tests () + "Run all tests in arbitrary order." + (run-and-bind-result-list + (lambda () + (maphash-values + (lambda (test) + (when (typep test 'test-case) + (%run test))) + *test*)))) + +(defun run-all-tests! () + "Equivalent to (explain! (run-all-tests))." + (explain! (run-all-tests))) + +(defun run-all-test-suites () + "Run all test suites in arbitrary order." + (run-and-bind-result-list + (lambda () + (maphash-values + (lambda (test) + (when (typep test 'test-suite) + (format *test-dribble* "~& ~A: " (name test)) + (%run test))) + *test*)))) + +(defun run-all-test-suites! () + "Equivalent to (explain (run-all-test-suites))." + (explain! (run-all-test-suites))) + ;; Copyright (c) 2002-2003, Edward Marco Baringer ;; All rights reserved. ;;