I believe it works in all implementations, but I only tested the one I use, which is the SBCL.
No dependency.
1 - Load simplet system by quicklisp
(ql:quickload :simplet)
2 - Download and load simplet system by github and asdf
Download directly from github:
git clone https://github.com/noloop/simplet.git
and load by ASDF:
(asdf:load-system :simplet)Note: Remember to configure asdf to find your directory where you downloaded the libraries (asdf call them "systems") above, if you do not know how to make a read at: https://common-lisp.net/project/asdf/asdf/Configuring-ASDF-to-find-your-systems.html or https://lisp-lang.org/learn/writing-libraries.
SIMPLET> (suite "Suite 1"
(test "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test "Test three equal three" #'(lambda () (= 3 3))))SIMPLET> (run)
#...Simplet...#
Test one equal one: T
Test two equal two: T
Suite 1: T
Test three equal three: T
Suite 2: T
Runner result: T
NILYou also can getting an string of run, instead of printing on REPL:
SIMPLET> (run :return-string-p t)
NILIt's simple to add a suite or test PENDING. To the suites, just do not add tests to it. To the tests just do not add a test function. Suites and tests PENDING do not make the runner result fail, however they are marked with PENDING instead of T. See the example below:
SIMPLET> (suite "Suite 1"
(test "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two"))
SIMPLET> (suite "Suite 2")
SIMPLET> (run)
#...Simplet...#
Test one equal one: T
Test two equal two: PENDING
Suite 1: T
Suite 2: PENDING
Runner result: T
NILFor suites only:
SIMPLET> (suite-only "Suite 1"
(test "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test "Test three equal three" #'(lambda () (= 3 3))))
SIMPLET> (run)
#...Simplet...#
Test one equal one: T
Test two equal two: T
Suite 1: T
Runner result: T
NILFor tests only:
SIMPLET> (suite "Suite 1"
(test-only "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test-only "Test three equal three" #'(lambda () (= 3 3))))
SIMPLET> (run)
#...Simplet...#
Test one equal one: T
Suite 1: T
Test three equal three: T
Suite 2: T
Runner result: T
NILFor suites skip:
SIMPLET> (suite-skip "Suite 1"
(test "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test "Test three equal three" #'(lambda () (= 3 3))))
SIMPLET> (run)
#...Simplet...#
Test three equal three: T
Suite 2: T
Runner result: T
NILFor tests skip:
SIMPLET> (suite "Suite 1"
(test-skip "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test-skip "Test three equal three" #'(lambda () (= 3 3))))
SIMPLET> (run)
#...Simplet...#
Test two equal two: T
Suite 1: T
Suite 2: T
Runner result: T
NILBeware of traps when mixing only and skip:
SIMPLET> (suite-skip "Suite 1"
(test-only "Test one equal one" #'(lambda () (= 1 1)))
(test "Test two equal two" #'(lambda () (= 2 2))))
SIMPLET> (suite "Suite 2"
(test "Test three equal three" #'(lambda () (= 3 3))))
SIMPLET> (run)
#...Simplet...#
Runner result: T
NILDo not forget to add :defsystem-depends-on (:simplet-asdf) to your-app.asd system definition file, this will enable:test-file in the :components. The class :test-file is similar to:file except it will be loaded only when call asdf:test-system. See an example below:
(defsystem :your-app
;; ...
:in-order-to ((test-op (test-op your-app/test))))
(defsystem :your-app/test
:author "your <your@youremail.com>"
:depends-on (:your-app :simplet)
:defsystem-depends-on (:simplet-asdf)
:components ((:module "test"
:components
((:test-file "your-app-test"))))
:perform (test-op (op c) (symbol-call :simplet '#:run)))
To run tests with ASDF:
(asdf:test-system :your-app)- Whitout cacth error
- Solely synchronous tests
- Whitout fixtures
- Whitout timeout
- Without recursives suites
- Without assertion libraries integration
- Not possible execution of tests whitout suites(because not contain the concept of root-suite.)
function (suite description &rest tests)
function (suite-only description &rest tests)
function (suite-skip description &rest tests)
function (test description &optional fn)
function (test-only description &optional fn)
function (test-skip description &optional fn)
function (run &key return-string-p)