The cl-fuzz Reference Manual

Table of Contents

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

The cl-fuzz Reference Manual

This is the cl-fuzz Reference Manual, version 0.0.1, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 08:07:40 2019 GMT+0.


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

1 Introduction

CL-FUZZ
=======
A simple fuzz-testing package for Common Lisp

API documentation: http://ndantam.github.com/cl-fuzz

Usage
=====
* Load CL-FUZZ via asdf
* Define a function to generate random data, aka the fuzz
* Define a function to perform some tests on the fuzz
* Pass these functions to FUZZ:PERFORM-TESTS
* For more details, see http://ndantam.github.com/cl-fuzz
  and the included example.lisp file

Example
=======
A trivial example to test #'EVENP and #'ODDP:

    (fuzz:run-tests (lambda () (* 2 (random 1000)))                   ; generator
                    (lambda (fuzz)                                    ; tester
                      (fuzz:test-true 'even (lambda () (evenp fuzz))) ; test 1
                      (fuzz:test-false 'odd (lambda () (oddp fuzz)))) ; test 2
                    :count 100)


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 cl-fuzz

Author

Neil T. Dantam

License

BSD-2

Description

A Fuzz Testing Framework

Version

0.0.1

Dependency

alexandria

Source

cl-fuzz.asd (file)

Component

fuzz.lisp (file)


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 cl-fuzz.asd

Location

cl-fuzz.asd

Systems

cl-fuzz (system)


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

3.1.2 cl-fuzz/fuzz.lisp

Parent

cl-fuzz (system)

Location

fuzz.lisp

Packages

cl-fuzz

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 cl-fuzz

Source

fuzz.lisp (file)

Nickname

fuzz

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: do-test (NAME &key TEST) EXPECTED-EXPRESSION TEST-EXPRESSION

Compares the result of ‘EXPECTED-EXPRESSION’ and ‘TEST-EXPRESSION’ using ‘TEST’.

NAME: A name for this test.
TEST: (lambda (expected-value actual-value)) => (or t nil).

Package

cl-fuzz

Source

fuzz.lisp (file)


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

5.1.2 Functions

Function: run-tests GENERATOR TESTER &key FORMATTER LOG COUNT

Perform a series of fuzz tests.
GENERATOR: (lambda ()) => fuzz.
TESTER: (lambda (fuzz)) => nil, performs one set of fuzz tests.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-eq NAME EXPECTED-FUNCTION TEST-FUNCTION

Call EXPECTED-FUNCTION and TEST-FUNCTION and test if results are #’EQ.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-eql NAME EXPECTED-FUNCTION TEST-FUNCTION

Call EXPECTED-FUNCTION and TEST-FUNCTION and test if results are #’EQL.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-equal NAME EXPECTED-FUNCTION TEST-FUNCTION

Call EXPECTED-FUNCTION and TEST-FUNCTION and test if results are #’EQUAL.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-equalp NAME EXPECTED-FUNCTION TEST-FUNCTION

Call EXPECTED-FUNCTION and TEST-FUNCTION and test if results are #’EQUALP.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-false NAME TEST-FUNCTION

Call TEST-FUNCTION and test if result is false.

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-predicate NAME PREDICATE &rest RESULT-FUNCTIONS

Test if PREDICATE applied to the results other arguments is T.

PREDICATE: (or (lambda (a b)) (lambda (a)))
RESULT-FUNCTIONS: (lambda ()) – returns the arguments for predicate

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test-true NAME TEST-FUNCTION

Call TEST-FUNCTION with no arguments. If result is true, mark successful test. If result is false, print an error message. NAME: name of this test
TEST-FUNCTION: (lambda ()) => (or nil RESULT)
RESULT: the result of TEST-FUNCTION

Package

cl-fuzz

Source

fuzz.lisp (file)

Function: test= NAME EXPECTED-FUNCTION TEST-FUNCTION

Call EXPECTED-FUNCTION and TEST-FUNCTION and test if results are #’=.

Package

cl-fuzz

Source

fuzz.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *fuzz-counts*
Package

cl-fuzz

Source

fuzz.lisp (file)

Special Variable: *fuzz-input*
Package

cl-fuzz

Source

fuzz.lisp (file)

Special Variable: *fuzz-log*
Package

cl-fuzz

Source

fuzz.lisp (file)

Special Variable: *fuzz-random*
Package

cl-fuzz

Source

fuzz.lisp (file)

Special Variable: *fuzz-trail*
Package

cl-fuzz

Source

fuzz.lisp (file)

Special Variable: *fuzz-var*
Package

cl-fuzz

Source

fuzz.lisp (file)


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

5.2.2 Macros

Macro: do-operations (VAR-LAMBDA-LIST &optional INITIAL) FUZZ &body CASES

Perform a series of operations on the fuzz.

Each case should return the value after processing the current operation, or NIL if the test failed. INITIAL and the true result of each of CASES will be DESTRUCTURING-BIND’ed to VAR-LAMBDA-LIST.

FUZZ: (list (list &rest operation))
CASES: ((destructuring-case-lambda-list) &body body) => result

Package

cl-fuzz

Source

fuzz.lisp (file)


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
cl-fuzz.asd: The cl-fuzz<dot>asd file
cl-fuzz/fuzz.lisp: The cl-fuzz/fuzz<dot>lisp file

F
File, Lisp, cl-fuzz.asd: The cl-fuzz<dot>asd file
File, Lisp, cl-fuzz/fuzz.lisp: The cl-fuzz/fuzz<dot>lisp file

L
Lisp File, cl-fuzz.asd: The cl-fuzz<dot>asd file
Lisp File, cl-fuzz/fuzz.lisp: The cl-fuzz/fuzz<dot>lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   D   F   M   R   T  
Index Entry  Section

D
do-operations: Internal macros
do-test: Exported macros

F
Function, run-tests: Exported functions
Function, test-eq: Exported functions
Function, test-eql: Exported functions
Function, test-equal: Exported functions
Function, test-equalp: Exported functions
Function, test-false: Exported functions
Function, test-predicate: Exported functions
Function, test-true: Exported functions
Function, test=: Exported functions

M
Macro, do-operations: Internal macros
Macro, do-test: Exported macros

R
run-tests: Exported functions

T
test-eq: Exported functions
test-eql: Exported functions
test-equal: Exported functions
test-equalp: Exported functions
test-false: Exported functions
test-predicate: Exported functions
test-true: Exported functions
test=: Exported functions

Jump to:   D   F   M   R   T  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*fuzz-counts*: Internal special variables
*fuzz-input*: Internal special variables
*fuzz-log*: Internal special variables
*fuzz-random*: Internal special variables
*fuzz-trail*: Internal special variables
*fuzz-var*: Internal special variables

S
Special Variable, *fuzz-counts*: Internal special variables
Special Variable, *fuzz-input*: Internal special variables
Special Variable, *fuzz-log*: Internal special variables
Special Variable, *fuzz-random*: Internal special variables
Special Variable, *fuzz-trail*: Internal special variables
Special Variable, *fuzz-var*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-fuzz: The cl-fuzz system
cl-fuzz: The cl-fuzz package

P
Package, cl-fuzz: The cl-fuzz package

S
System, cl-fuzz: The cl-fuzz system

Jump to:   C   P   S