From: Olof-Joachim Frahm Date: Mon, 10 Jun 2013 20:49:08 +0000 (+0200) Subject: Better tests organization, ASDF integration. X-Git-Tag: 1.0.0~11 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=346a578e2303a8c58192925d192fed44853b4988;p=cl-mock.git Better tests organization, ASDF integration. --- diff --git a/cl-mock.asd b/cl-mock.asd index 6774d07..54861d6 100644 --- a/cl-mock.asd +++ b/cl-mock.asd @@ -8,8 +8,26 @@ :author "Olof-Joachim Frahm " :license "Simplified BSD License" :depends-on (#:closer-mop) + :in-order-to ((asdf:test-op (asdf:load-op #:cl-mock-tests))) + :perform (asdf:test-op :after (op c) + (funcall (find-symbol (symbol-name '#:run!) '#:fiveam) + (find-symbol (symbol-name '#:cl-mock) '#:cl-mock-tests))) :serial T :components ((:module "src" :components ((:file "package") - (:file "functions"))))) + (:file "functions") + (:file "mock") + (:file "methods") + (:file "facade"))))) + +(asdf:defsystem #:cl-mock-tests + :depends-on (#:cl-mock #:fiveam) + :serial T + :components ((:module "tests" + :components + ((:file "package") + (:file "suite") + (:file "functions") + (:file "facade") + (:file "methods"))))) diff --git a/tests/facade.lisp b/tests/facade.lisp index 86962a4..2eeeec8 100644 --- a/tests/facade.lisp +++ b/tests/facade.lisp @@ -2,7 +2,7 @@ (in-package #:cl-mock-tests) -(import 'cl-mock::(call-with-mocks make-mock-bindings register-mock if-called when-called call-previous)) +(in-suite cl-mock) (def-test call-with-mocks.empty () (is (eq T (call-with-mocks diff --git a/tests/functions.lisp b/tests/functions.lisp index d3acdc3..4b0a000 100644 --- a/tests/functions.lisp +++ b/tests/functions.lisp @@ -2,6 +2,8 @@ (in-package #:cl-mock-tests) +(in-suite cl-mock) + (def-test dflet.calls-binding () (dflet ((foo () 23)) (is (eql 23 (foo))))) diff --git a/tests/methods.lisp b/tests/methods.lisp index 36b7894..fa88e4a 100644 --- a/tests/methods.lisp +++ b/tests/methods.lisp @@ -2,7 +2,7 @@ (in-package #:cl-mock-tests) -(import 'cl-mock::(progm)) +(in-suite cl-mock) (defclass foo () ()) diff --git a/tests/package.lisp b/tests/package.lisp index fe62325..0faeab1 100644 --- a/tests/package.lisp +++ b/tests/package.lisp @@ -3,4 +3,5 @@ (in-package #:cl-user) (defpackage #:cl-mock-tests - (:use #:cl #:cl-mock #:fiveam)) + (:use #:cl #:cl-mock #:fiveam) + (:import-from #:cl-mock #:call-with-mocks #:progm #:make-mock-bindings #:if-called #:when-called)) diff --git a/tests/suite.lisp b/tests/suite.lisp new file mode 100644 index 0000000..04d89be --- /dev/null +++ b/tests/suite.lisp @@ -0,0 +1,3 @@ +(in-package #:cl-mock-tests) + +(def-suite cl-mock)