From 5d83672b8d9cbc7179dcced2e25bc30253c34519 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Thu, 23 Aug 2012 21:13:52 +0200 Subject: [PATCH] Implement RUN-ALL-TESTS and friends. --- src/package.lisp | 3 +++ src/run.lisp | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) 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. ;; -- 1.7.10.4