The trivial-coverage Reference Manual

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

The trivial-coverage Reference Manual

This is the trivial-coverage Reference Manual, version 0.0.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 06:02:47 2022 GMT+0.

Table of Contents


1 Introduction

Trivial Coverage Manual

[in package TRIVIAL-COVERAGE]

pipeline status Quicklisp

Description

A simple Common Lisp library to print out the code coverage collected. Supports SBCL and CCL.

Installing trivial-coverage

This project is available in the latest QuickLisp distribution, so installing it is reduced to calling:

(ql:quickload :trivial-coverage)

But if you want access to the latest updates, install it by cloning the Git repository with

cd $HOME/quicklisp/local-projects
git clone https://gitlab.com/ediethelm/trivial-coverage.git

and then loading it as usual via QuickLisp as above.

Working Example

Assuming there is a system being tested and named :system-under-test, which has three files that should not be included in the coverage calculation. The following expression loads the system, executes the tests and reports the total coverage:

(trivial-coverage:test-and-print-coverage :system-under-test 
                                          :exclude '("test-system-under-test.lisp" 
                                                     "test-data-generator.lisp"
                                                     "documentation.lisp"))

To access the coverage value programatically the following is possible:

(declaim (optimize sb-cover:store-coverage-data))
((asdf:oos 'asdf:load-op :system-under-test)
(let ((report-path (merge-pathnames "coverage-report/" (asdf:system-source-directory :system-under-test))))
	   (sb-cover:reset-coverage)
	   (asdf:oos 'asdf:test-op :system-under-test)
	   (sb-cover:report report-path)
	   (get-coverage report-path :exclude exclude))

Exported Symbols

License Information

This library is released under the MIT License. Please refer to the LICENSE to get the full licensing text.

Contributing to this project

Please refer to the CONTRIBUTING document for more information.


2 Systems

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


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

2.1 trivial-coverage

A simple Common Lisp library to print out the code coverage collected. Supports SBCL and CCL.

Author

Eric Diethelm <ediethelm@yahoo.com>

License

MIT

Version

0.0.4

Dependency

lquery (system).

Source

trivial-coverage.asd.

Child Components

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   [Contents][Index]

3.1.1 trivial-coverage/trivial-coverage.asd

Source

trivial-coverage.asd.

Parent Component

trivial-coverage (system).

ASDF Systems

trivial-coverage.


3.1.2 trivial-coverage/package.lisp

Source

trivial-coverage.asd.

Parent Component

trivial-coverage (system).

Packages

trivial-coverage.


3.1.3 trivial-coverage/trivial-coverage.lisp

Source

trivial-coverage.asd.

Parent Component

trivial-coverage (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


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

4.1 trivial-coverage

A simple Common Lisp library to print out the code coverage collected by sb-cover. As such it only supports SBCL.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


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

5.1 Public Interface


5.1.1 Ordinary functions

Function: get-coverage (report-path &key exclude)

Calculates the total code coverage reported by sb-cover (via the HTML report) and returns this value. *report-path* - the path to the directory containing the HTML coverage report
*exclude* - files to be excluded from the calculation

Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: test-and-print-coverage (system &key exclude keep-report stream)

Loads and tests the given *system* collecting coverage information. Also prints a line containing the coverage to *stream*. *system* - name of the system to be tested
*exclude* - files to be excluded from the calculation
*keep-report* - if NIL, the generated HTML coverage files are removed
*stream* - the stream to which the coverage result shall be written

Package

trivial-coverage.

Source

trivial-coverage.lisp.


5.2 Internals


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

5.2.1 Ordinary functions

Function: clear-coverage ()
Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: create-coverage-report (path)
Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: disable-coverage ()
Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: enable-coverage ()
Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: get-coverage-for-file (html)
Package

trivial-coverage.

Source

trivial-coverage.lisp.

Function: pprint-coverage (coverage &key stream)
Package

trivial-coverage.

Source

trivial-coverage.lisp.


Appendix A Indexes


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

A.1 Concepts


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

A.3 Variables