Better tests organization, ASDF integration.
authorOlof-Joachim Frahm <olof@macrolet.net>
Mon, 10 Jun 2013 20:49:08 +0000 (22:49 +0200)
committerOlof-Joachim Frahm <olof@macrolet.net>
Mon, 10 Jun 2013 20:49:08 +0000 (22:49 +0200)
cl-mock.asd
tests/facade.lisp
tests/functions.lisp
tests/methods.lisp
tests/package.lisp
tests/suite.lisp [new file with mode: 0644]

index 6774d07..54861d6 100644 (file)
@@ -8,8 +8,26 @@
   :author "Olof-Joachim Frahm <olof@macrolet.net>"
   :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")))))
index 86962a4..2eeeec8 100644 (file)
@@ -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
index d3acdc3..4b0a000 100644 (file)
@@ -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)))))
index 36b7894..fa88e4a 100644 (file)
@@ -2,7 +2,7 @@
 
 (in-package #:cl-mock-tests)
 
-(import 'cl-mock::(progm))
+(in-suite cl-mock)
 
 (defclass foo ()
   ())
index fe62325..0faeab1 100644 (file)
@@ -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 (file)
index 0000000..04d89be
--- /dev/null
@@ -0,0 +1,3 @@
+(in-package #:cl-mock-tests)
+
+(def-suite cl-mock)