The checkl Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The checkl Reference Manual

This is the checkl Reference Manual, version 1.0, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 13:20:54 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

CheckL

Why write programs in Common Lisp but tests like Java?

My workflow for writing Common Lisp tends to be like this:

Testing is already inherent in this process, all we need is a little bit of Common Lisp magic to take advantage of it. Thus, CheckL:

(defun foo ()
  (+ 1 1))

(check () (foo)) ;; => 2

(defun foo ()
  (+ 1 2))

(check () (foo))

    |
    v

Result 0 has changed: 3
Previous result: 2
   [Condition of type CHECKL::RESULT-ERROR]

Restarts:
 0: [USE-NEW-VALUE] The new value is correct, use it from now on.
 1: [SKIP-TEST] Skip this, leaving the old value, but continue testing
 2: [RETRY] Retry SLIME interactive evaluation request.
 3: [*ABORT] Return to SLIME's top level.
 4: [TERMINATE-THREAD] Terminate this thread (#<THREAD "worker" RUNNING {100586AB13}>)

See the full documentation for more details!


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 checkl

Author

Ryan Pavlik <rpavlik@gmail.com>

License

LLGPL, BSD

Description

CheckL: Dynamic testing for Common Lisp

Version

1.0

Dependency

marshal

Source

checkl.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 checkl.asd

Location

checkl.asd

Systems

checkl (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 checkl/package.lisp

Parent

checkl (system)

Location

package.lisp

Packages

checkl


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 checkl/checkl.lisp

Dependency

package.lisp (file)

Parent

checkl (system)

Location

checkl.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 checkl

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: check (&key NAME CATEGORY OUTPUT-P) &body BODY

=> test-results

Run ‘BODY‘. Check resulting values against the last run using ‘CHECKL:RESULT-EQUALP‘, or store them if this is the first run. Sameness of the test is determined by comparing the body with ‘EQUALP‘, or by ‘NAME‘.

‘NAME‘ may be specified to name a test. If the test exists but is anonymous (i.e., ‘NAME‘ has not been specified), specifying ‘NAME‘ will name the test and it will no longer be anonymous.

‘CATEGORY‘ may be specified for running groups of tests.

If ‘OUTPUT-P‘ is ‘t‘, the results will be printed to ‘*standard-output*‘ as well as returned. This may be helpful if the results are too long to see in your emacs minibuffer.

Package

checkl

Source

checkl.lisp (file)

Macro: check-output &body BODY

Use this within a ‘CHECK‘ block. Rebind ‘*standard-output*‘ and ‘*error-output*‘ and return a ‘CHECK‘-able result.

Package

checkl

Source

checkl.lisp (file)

Macro: results &rest VALUES

=> VALUES

This will evaluate each subform in order and call RESULT-TRANSLATE on the result. This is especially useful if subforms repeatedly modify and return the object, e.g. ‘(results (incf *x*) (incf *x*))‘.

If multiple values are returned, each value is mapped via RESULT-TRANSLATE and the result is returned as a list of the translated values.

Package

checkl

Source

checkl.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: checkl-load &optional FILESPEC

Load package test results from ‘FILESPEC‘

Package

checkl

Source

checkl.lisp (file)

Function: checkl-store &optional FILESPEC

Store package test results to ‘FILESPEC‘

Package

checkl

Source

checkl.lisp (file)

Function: clear &rest NAMES

Clear the test results from the tests ‘NAMES‘. For clearing anonymous test results, see ‘CLEAR-ANONYMOUS‘.

Package

checkl

Source

checkl.lisp (file)

Function: clear-anonymous ()

Clear anonymous test results. For clearing named tests, see ‘CLEAR‘.

Package

checkl

Source

checkl.lisp (file)

Function: run &rest NAMES

=> test-results

Run tests named ‘NAMES‘, collecting their results.

Package

checkl

Source

checkl.lisp (file)

Function: run-all &optional CATEGORY &rest CATEGORIES

=> test-results

Run all tests, optionally specifying categories.

Package

checkl

Source

checkl.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: result-equalp O1 O2

Generic function to compare test results ‘O1‘ to ‘O2‘. Defaults to ‘EQUALP‘.

Package

checkl

Source

checkl.lisp (file)

Methods
Method: result-equalp O1 O2
Generic Function: result-translate RESULT

RESULT-TRANSLATE is called on RESULT before calling
RESULT-EQUALP and before storing RESULT. This defaults to RESULT, but may be useful for converting more complex objects into simpler objects. For sequences and structures, COPY-SEQ and COPY-STRUCTURE are called. For STANDARD-OBJECT instances, (MS:UNMARSHAL (MS:MARSHAL OBJECT)) is called.

Package

checkl

Source

checkl.lisp (file)

Methods
Method: result-translate (RESULT standard-object)
Method: result-translate (RESULT structure-object)
Method: result-translate (RESULT sequence)
Method: result-translate RESULT

Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Classes

Class: test-values ()

An ASDF component for loading CheckL test values.

Package

checkl

Source

checkl.lisp (file)

Direct superclasses

static-file (class)

Direct methods
Direct slots
Slot: package
Initargs

:package

Readers

test-values-package (generic function)

Writers

(setf test-values-package) (generic function)

Class: tests ()

Load a file with CHECK or CHECK-FORMAL tests.

Package

checkl

Source

checkl.lisp (file)

Direct superclasses

cl-source-file (class)

Direct methods

perform (method)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *all-tests*
Package

checkl

Source

checkl.lisp (file)

Special Variable: *definitions-only*
Package

checkl

Source

checkl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: do-categories (VAR TESTS) &body BODY
Package

checkl

Source

checkl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: copy-package-tests INSTANCE
Package

checkl

Source

checkl.lisp (file)

Function: current-tests ()
Package

checkl

Source

checkl.lisp (file)

Function: ensure-test TEST-NAME TEST-CATEGORY TEST-BODY FUNCTION
Package

checkl

Source

checkl.lisp (file)

Function: make-package-tests &key (RESULTS RESULTS) (CATEGORIES CATEGORIES) (LAMBDAS LAMBDAS) (DEFAULT-CHECKL-STORE DEFAULT-CHECKL-STORE)
Package

checkl

Source

checkl.lisp (file)

Function: package-tests-categories INSTANCE
Function: (setf package-tests-categories) VALUE INSTANCE
Package

checkl

Source

checkl.lisp (file)

Function: package-tests-default-checkl-store INSTANCE
Function: (setf package-tests-default-checkl-store) VALUE INSTANCE
Package

checkl

Source

checkl.lisp (file)

Function: package-tests-lambdas INSTANCE
Function: (setf package-tests-lambdas) VALUE INSTANCE
Package

checkl

Source

checkl.lisp (file)

Function: package-tests-p OBJECT
Package

checkl

Source

checkl.lisp (file)

Function: package-tests-results INSTANCE
Function: (setf package-tests-results) VALUE INSTANCE
Package

checkl

Source

checkl.lisp (file)

Function: verify-result NAME RESULT
Package

checkl

Source

checkl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Generic functions

Generic Function: result-error-index CONDITION
Package

checkl

Methods
Method: result-error-index (CONDITION result-error)
Source

checkl.lisp (file)

Generic Function: result-error-last CONDITION
Package

checkl

Methods
Method: result-error-last (CONDITION result-error)
Source

checkl.lisp (file)

Generic Function: result-error-value CONDITION
Package

checkl

Methods
Method: result-error-value (CONDITION result-error)
Source

checkl.lisp (file)

Generic Function: test-values-package OBJECT
Generic Function: (setf test-values-package) NEW-VALUE OBJECT
Package

checkl

Methods
Method: test-values-package (TEST-VALUES test-values)

automatically generated reader method

Source

checkl.lisp (file)

Method: (setf test-values-package) NEW-VALUE (TEST-VALUES test-values)

automatically generated writer method

Source

checkl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Conditions

Condition: result-error ()
Package

checkl

Source

checkl.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: result-index
Initargs

:result-index

Initform

(quote nil)

Readers

result-error-index (generic function)

Slot: result-value
Initargs

:result-value

Initform

(quote nil)

Readers

result-error-value (generic function)

Slot: last-value
Initargs

:last-value

Initform

(quote nil)

Readers

result-error-last (generic function)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Structures

Structure: package-tests ()
Package

checkl

Source

checkl.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: results
Initform

(make-hash-table :test (quote equalp))

Readers

package-tests-results (function)

Writers

(setf package-tests-results) (function)

Slot: categories
Initform

(make-hash-table :test (quote equalp))

Readers

package-tests-categories (function)

Writers

(setf package-tests-categories) (function)

Slot: lambdas
Initform

(make-hash-table :test (quote equalp))

Readers

package-tests-lambdas (function)

Writers

(setf package-tests-lambdas) (function)

Slot: default-checkl-store
Readers

package-tests-default-checkl-store (function)

Writers

(setf package-tests-default-checkl-store) (function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
checkl.asd: The checkl<dot>asd file
checkl/checkl.lisp: The checkl/checkl<dot>lisp file
checkl/package.lisp: The checkl/package<dot>lisp file

F
File, Lisp, checkl.asd: The checkl<dot>asd file
File, Lisp, checkl/checkl.lisp: The checkl/checkl<dot>lisp file
File, Lisp, checkl/package.lisp: The checkl/package<dot>lisp file

L
Lisp File, checkl.asd: The checkl<dot>asd file
Lisp File, checkl/checkl.lisp: The checkl/checkl<dot>lisp file
Lisp File, checkl/package.lisp: The checkl/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
C   D   E   F   G   M   P   R   T   V  
Index Entry  Section

(
(setf package-tests-categories): Internal functions
(setf package-tests-default-checkl-store): Internal functions
(setf package-tests-lambdas): Internal functions
(setf package-tests-results): Internal functions
(setf test-values-package): Internal generic functions
(setf test-values-package): Internal generic functions

C
check: Exported macros
check-output: Exported macros
checkl-load: Exported functions
checkl-store: Exported functions
clear: Exported functions
clear-anonymous: Exported functions
copy-package-tests: Internal functions
current-tests: Internal functions

D
do-categories: Internal macros

E
ensure-test: Internal functions

F
Function, (setf package-tests-categories): Internal functions
Function, (setf package-tests-default-checkl-store): Internal functions
Function, (setf package-tests-lambdas): Internal functions
Function, (setf package-tests-results): Internal functions
Function, checkl-load: Exported functions
Function, checkl-store: Exported functions
Function, clear: Exported functions
Function, clear-anonymous: Exported functions
Function, copy-package-tests: Internal functions
Function, current-tests: Internal functions
Function, ensure-test: Internal functions
Function, make-package-tests: Internal functions
Function, package-tests-categories: Internal functions
Function, package-tests-default-checkl-store: Internal functions
Function, package-tests-lambdas: Internal functions
Function, package-tests-p: Internal functions
Function, package-tests-results: Internal functions
Function, run: Exported functions
Function, run-all: Exported functions
Function, verify-result: Internal functions

G
Generic Function, (setf test-values-package): Internal generic functions
Generic Function, result-equalp: Exported generic functions
Generic Function, result-error-index: Internal generic functions
Generic Function, result-error-last: Internal generic functions
Generic Function, result-error-value: Internal generic functions
Generic Function, result-translate: Exported generic functions
Generic Function, test-values-package: Internal generic functions

M
Macro, check: Exported macros
Macro, check-output: Exported macros
Macro, do-categories: Internal macros
Macro, results: Exported macros
make-package-tests: Internal functions
Method, (setf test-values-package): Internal generic functions
Method, result-equalp: Exported generic functions
Method, result-error-index: Internal generic functions
Method, result-error-last: Internal generic functions
Method, result-error-value: Internal generic functions
Method, result-translate: Exported generic functions
Method, result-translate: Exported generic functions
Method, result-translate: Exported generic functions
Method, result-translate: Exported generic functions
Method, test-values-package: Internal generic functions

P
package-tests-categories: Internal functions
package-tests-default-checkl-store: Internal functions
package-tests-lambdas: Internal functions
package-tests-p: Internal functions
package-tests-results: Internal functions

R
result-equalp: Exported generic functions
result-equalp: Exported generic functions
result-error-index: Internal generic functions
result-error-index: Internal generic functions
result-error-last: Internal generic functions
result-error-last: Internal generic functions
result-error-value: Internal generic functions
result-error-value: Internal generic functions
result-translate: Exported generic functions
result-translate: Exported generic functions
result-translate: Exported generic functions
result-translate: Exported generic functions
result-translate: Exported generic functions
results: Exported macros
run: Exported functions
run-all: Exported functions

T
test-values-package: Internal generic functions
test-values-package: Internal generic functions

V
verify-result: Internal functions

Jump to:   (  
C   D   E   F   G   M   P   R   T   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
C   D   L   P   R   S  
Index Entry  Section

*
*all-tests*: Internal special variables
*definitions-only*: Internal special variables

C
categories: Internal structures

D
default-checkl-store: Internal structures

L
lambdas: Internal structures
last-value: Internal conditions

P
package: Exported classes

R
result-index: Internal conditions
result-value: Internal conditions
results: Internal structures

S
Slot, categories: Internal structures
Slot, default-checkl-store: Internal structures
Slot, lambdas: Internal structures
Slot, last-value: Internal conditions
Slot, package: Exported classes
Slot, result-index: Internal conditions
Slot, result-value: Internal conditions
Slot, results: Internal structures
Special Variable, *all-tests*: Internal special variables
Special Variable, *definitions-only*: Internal special variables

Jump to:   *  
C   D   L   P   R   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   R   S   T  
Index Entry  Section

C
checkl: The checkl system
checkl: The checkl package
Class, test-values: Exported classes
Class, tests: Exported classes
Condition, result-error: Internal conditions

P
Package, checkl: The checkl package
package-tests: Internal structures

R
result-error: Internal conditions

S
Structure, package-tests: Internal structures
System, checkl: The checkl system

T
test-values: Exported classes
tests: Exported classes

Jump to:   C   P   R   S   T