4 Testing Utilities

▼ |  | Rack Unit: Unit Testing

1 | Quick Start Guide for Rack Unit
2 | The Philosophy of Rack Unit
3 | Rack Unit API
4 | Testing Utilities
5 | Rack Unit Internals and Extension API
6 | Release Notes
7 | Acknowlegements
| Index

► | 4 | Testing Utilities

4.1 | Checking documentation completeness
4.2 | Logging Test Results

On this page:

4.1`` Checking documentation completeness
check-docs
4.2`` Logging Test Results
test-log!
test-log

top ← prev up next →

### 4`` Testing Utilities

#### 4.1`` Checking documentation completeness

(require rackunit/docs-complete) | package: racket-index

> procedure (check-docs lib [#:skip skip]) → any
> lib : symbol?
> | skip |  | : |  |
> (or/c regexp?
> symbol?
> (listof (or/c regexp? symbol?))
> (-> symbol? any)
> #f)
> |  | = |  | #f

Checks to see if the module path named by lib (e.g. 'racket/list) has documented all of its exports and prints an error message to (current-error-port) if not.

If skip is a regexp, then exporting matching that regexp are ignored. If it is a symbol, then that export is ignored. If it is a list of symbols and regexps, then any exporting matching any of the symbols or regexps are ignored. If it is a function, the function is treated as a predicate and passed each export of the module. If skip is #f, no exports are skipped.

#### 4.2`` Logging Test Results

(require rackunit/log) | package: testing-util-lib

Rackunit provides a general purpose library for tracking test results and displaying a summary message.

> procedure (test-log! result) → void?
> result : any/c

Adds a test result to the running log. If result is false, then the test is considered a failure.

> > procedure
> > (test-log | [ | #:display? display? |
> > |  | #:exit? exit?]) |
> | → |  |
> (cons/c exact-nonnegative-integer?
> exact-nonnegative-integer?)
> display? : boolean? = #t
> exit? : boolean? = #t

Processes the running test log. The first integer is the failed tests, the second is the total tests. If display? is true, then a message is displayed. If there were failures, the message is printed on (current-error-port). If exit? is true, then if there were failures, calls (exit 1).
top ← prev up next →