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
test-log-enabled?
current-test-invocation-directory

Racket
top contents ← 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 : module-path?
> | 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.

Changed in version 1.10 of package racket-index: Changed lib to accept any module path.

### 4.2 Logging Test Results🔗ℹ

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

> NOTE: This library is deprecated; use raco/testing, instead.

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

Re-exports test-log! from raco/testing.

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

Re-exports test-report from raco/testing.

Changed in version 1.11 of package testing-util-lib: Allow any value for the display? and exit? arguments, not just booleans.

> parameter (test-log-enabled?) → boolean?
> (test-log-enabled? enabled?) → void?
> enabled? : any/c
> = | #t

Re-exports test-log-enabled? from raco/testing.

Added in version 1.1 of package testing-util-lib.
Changed in version 1.11: Allow any value for the parameter and coerce it to a boolean.

> parameter (current-test-invocation-directory) → (or/c #f path-string?)
> (current-test-invocation-directory test-invocation-directory)
> → void?
> test-invocation-directory : (or/c #f path-string?)
> = | #f

Re-exports current-test-invocation-directory from raco/testing.

Added in version 1.2 of package testing-util-lib.

top contents ← prev up next →