/cover

a code coverage tool for racket

Primary LanguageRacketMIT LicenseMIT

Cover

Build Status Coverage Status Scribble

This library is an extensible code coverage tool for racket. It comes with the ability to generate HTML reports, and has extensions to submit coverage reports to Codecov and Coveralls. You can also create your own coverage formats.

How to install

Install via raco pkg install cover, or from the "File" -> "Install Package..." menu in DrRacket.

Basic Usage

The basic usage of Cover will generate an HTML report. For example, checkout and install this library and run raco cover . in that directory. Then open coverage/index.html in your favorite web browser. You should see something like this:

Example

You can sort the entries by clicking on the header for any column. You can see a more detailed view for any file by clicking on its name. For example, private/format-utils.rkt looks like:

Example2

You can view the arguments for Cover run raco cover -h.

Different Formats

Code coverage can be generated in a different format by specifying the -f <format> flag.

The only built in format is html simply generates html files for each source file containing coverage information and highlighted source code. This is the default.

If you would like to use Cover with Codecov see cover-codecov

If you would like to use Cover with Coveralls see cover-coveralls.

You can also build a custom output format. For more detailed usage see the full documentation.

Use with TravisCI

Cover works with Travis CI, however you may want to install an output format specialized to cover coverage service, like cover-coveralls.

Gotchas and Bugs

There is a list of odd behavior you may encounter when using Cover in the Gotcha's Section of the documentation.

Racket API

Cover comes with a racket API, which can be read about in the full documentation.