From c978852f91901252c7b8c5d5a1fd31918d374932 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 4 Feb 2024 11:02:32 -0800 Subject: test suites; readme --- README.org | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 3d6c449..657c4b9 100644 --- a/README.org +++ b/README.org @@ -20,7 +20,10 @@ This approach has several beneifts: end up compiled into executable code unless ~testiere~ is "on"), you get purposeful documentation of your code for free. Why read a comment when there's a test!? - +4. **Automatic Test Suite Definition** Tests of definition forms are + automatically added to a test suite associated with the package of + the name being defined. These tests can be run using + ~testiere:run-suites~. Out of the box, ~testiere~ supports testing of the following: @@ -235,6 +238,37 @@ tests that aren't part of the package you're testing." (:is (not (typep "foo" 'optional-int)))) '(or integer null)) #+end_src +*** Running the suite + +The above also defines a test suite for the forms defined in the +~:testiere.examples~ package. + +The ~RUN-SUITES~ function lets you run test suites associated with +packages. The `:AUTOMATIC-CONTINUE` argument avoids dropping into the +debugger, instead printing a test failure. + +If the ~:PACKAGES~ argument is empty, then all test suites known to +Testiere are run. + +#+begin_src lisp + +(run-suites :packages '(:testiere.examples) + :automatic-continue t) + +#+end_src + +#+begin_example + +Running tests for package "TESTIERE.EXAMPLES" + Testing DEFUN ADD3 [pass] + Testing DEFUN ADD10 [pass] + Testing DEFUN INCREMENT-COUNT [pass] + Testing DEFUN COUNT-WORDS-IN-RESPONSE [pass] + Testing DEFCLASS POINT [pass] + Testing DEFTYPE OPTIONAL-INT [pass] + +#+end_example + ** How does it work? -- cgit v1.2.3