a code coverage tool for racket
Go to file
Spencer Florence ae6ce31966 even more tests
2015-01-07 13:20:42 -05:00
private even more tests 2015-01-07 13:20:42 -05:00
scribblings fixing issues #13 2015-01-07 11:04:36 -05:00
tests fixed a contract bug 2015-01-02 14:48:52 -05:00
.gitignore added a gitignore 2014-12-28 15:08:43 -05:00
.travis.yml added the -p flag to remove standard pkg system files from the build 2015-01-07 10:39:19 -05:00
cover.rkt fixing issues #13 2015-01-07 11:04:36 -05:00
coverage.rkt initial commit 2014-09-22 17:03:24 -05:00
format.rkt added raw output: only useful for debugging 2014-12-30 12:18:05 -06:00
info.rkt force multipage documentation 2015-01-07 11:49:47 -05:00
main.rkt fixed a contract bug 2015-01-02 14:48:52 -05:00
raco.rkt improving test coverage 2015-01-07 11:49:57 -05:00
README.md updating docs 2015-01-07 11:00:55 -05:00
strace.rkt now disabling test coverage when its not needed 2014-12-28 22:24:14 -06:00

Cover

Build Status Coverage Status

This library is a supplement to rackets raco test that adds code coverage capabilities.

How to install

install via raco pkg install cover. To install for development, checkout the repo into a folder named cover and in the parent directory run raco pkg install cover/.

How to use

To view the arguments for Cover run raco cover -h.

Code coverage can be generated by specifying the -c <format> flag. Right now the valid formats are: html and coveralls.

html simply generates html files for each source file containing coverage information and highlighted source code.

coveralls generates a coveralls coverage report and sends it to coveralls.

For more detailed usage see the full documentation.

If any tests run by rackunit fail, Cover will return with exit code 1. If all tests pass it will return with exit code 0.

Use with TravisCI

If your code is hosted on a public github repo then you can use this plugin in conjunction with TravisCI and Coveralls. Just enable your repository on both services and then add a .travis.yml file to your repo with the following contents:

langauge: c
env:
  - RACKET_VERSION=6.1.1

before_install:
  - git clone https://github.com/greghendershott/travis-racket.git ../travis-racket
  - cat ../travis-racket/install-racket.sh | bash

script:
 - /usr/racket/bin/raco pkg install --deps search-auto $TRAVIS_BUILD_DIR # install dependencies
 - /usr/racket/bin/raco test $TRAVIS_BUILD_DIR # run tests. you wrote tests, right?
 - /usr/racket/bin/raco cover -c coveralls -d $TRAVIS_BUILD_DIR/coverage . # generate coverage information

The above Travis configuration will install any project dependencies, test your project, and report coverage information to coveralls.

For a contrived example project, look at an example. For additional Travis configuration information look at Travis Racket.

Note: This currently only works for public Github repos. This project does not support coveralls.yml configurations for private repos.

Internals

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