1.0.37.29: Cleanup from fasl format and fasdump logic changes.
[sbcl.git] / contrib / sb-cover / sb-cover.texinfo
1 @node sb-cover
2 @section sb-cover
3 @cindex Code Coverage
4
5 The @code{sb-cover} module provides a code coverage tool for SBCL. The
6 tool has support for expression coverage, and for some branch coverage.
7 Coverage reports are only generated for code compiled using
8 @code{compile-file} with the value of the
9 @code{sb-cover:store-coverage-data} optimization quality set to 3.
10
11 As of SBCL 1.0.6 @code{sb-cover} is still experimental, and the
12 interfaces documented here might change in later versions.
13
14 @subsection Example Usage
15
16 @lisp
17 ;;; Load SB-COVER
18 (require :sb-cover)
19
20 ;;; Turn on generation of code coverage instrumentation in the compiler
21 (declaim (optimize sb-cover:store-coverage-data))
22
23 ;;; Load some code, ensuring that it's recompiled with the new optimization
24 ;;; policy.
25 (asdf:oos 'asdf:load-op :cl-ppcre-test :force t)
26
27 ;;; Run the test suite.
28 (cl-ppcre-test:test)
29
30 ;;; Produce a coverage report
31 (sb-cover:report "/tmp/report/")
32
33 ;;; Turn off instrumentation
34 (declaim (optimize (sb-cover:store-coverage-data 0)))
35 @end lisp
36
37 @c @subsection Output
38 @c Write some documentation about how to interpret the results
39
40 @subsection Functions
41
42 @include fun-sb-cover-report.texinfo
43
44 @include fun-sb-cover-reset-coverage.texinfo
45
46 @include fun-sb-cover-clear-coverage.texinfo
47
48 @include fun-sb-cover-save-coverage.texinfo
49
50 @include fun-sb-cover-save-coverage-in-file.texinfo
51
52 @include fun-sb-cover-restore-coverage.texinfo
53
54 @include fun-sb-cover-restore-coverage-from-file.texinfo
55