rcov(1) rcov test coverage analysis rcov(1)
rcov - create a code coverage report for Ruby tests
rcov [options] <script1.rb> [script2.rb] [-- --extra-options]
rcov is a code coverage tool for Ruby. It creates code coverage reports showing the unit test coverage of the target code.
rcov does "statement coverage", also referred to as "C0 coverage analysis". It tests, if each line of the source code has been executed.
rcov is typically used to find the areas of a program that have not been sufficiently tested. It reports, what code has not been run by any
It can easily be integrated into build processes (e.g. with rake or rant) and creates the coverage reports in HTML or text format.
-I, --include PATHS
Prepend PATHS to $: (colon separated list)
Mark all comments by default. (default: --no-comments)
Only trace code executed inside TestCases.
Only trace code executed inside RSpec specs.
Create colorblind-safe output.
-i, --include-file PATTERNS
Generate info for files matching a pattern (comma-separated regexp list)
-x, --exclude PATTERN
Don't generate info for files matching a pattern (comma-separated regexp list)
Skip info only for files matching the given patterns.
Skip config/, environment/ and vendor/.
Show callsites in generated XHTML report. (somewhat slower; disabled by default)
Generate fully cross-referenced report. (includes --callsites)
Generate bogo-profiling info.
-r, --range RANGE
Color scale range for profiling info (dB).
Generate annotated source code.
Dump detailed plain-text report to stdout. (filename, LoC, total lines, coverage)
Dump plain-text summary to stdout.
Dump execution counts in plaintext.
Dump coverage info to stdout, using ANSI color sequences unless -n.
--gcc Dump uncovered line in GCC error format.
Aggregate data from previous runs in FILE. Overwrites FILE with the merged data. FILE is created if necessary.
-D, --text-coverage-diff [FILE]
Compare code coverage with saved state in FILE, defaults to coverage.info. Implies --comments.
Save coverage data to FILE, for later use with rcov -D. (default: coverage.info)
Generate HTML output. (default: --html)
Use a custom CSS file for HTML output. Specified as a relative path.
Sort files in the output by the specified field (name, loc, coverage)
Reverse files in the output.
Only list files with coverage < INT %. (default: 101)
Fail if the coverage is below the threshold (default: 100)
Charset used in Content-Type declaration of HTML reports.
Same as --threshold 100
Replace $0 when loading the .rb files.
-w Turn warnings on (like ruby).
Do not use the optimized C runtime. (will run 30-300 times slower)
Use PROGNAME for --text-coverage-diff. (default: diff)
Show extended help message
Report coverage analysis bug for the method specified by SELECTOR (format: Foo::Bar#method, A::B.method)
To simply run rcov on all ruby files in the current directory and create a HTML coverage report in ./coverage:
To run the tests in ./tests, include ./lib, only take care of code executed from TestCases and output a summary to STDOUT:
rcov --test-unit-only -t -I./lib ./tests/*.rb
runit(1), rake(1), rant(1)
Full Documentation about the integration into other tools is available in /usr/share/doc/rcov/README.*
The manpage is provided by Micah Anderson <firstname.lastname@example.org> as part of the Debian's rcov package. Upstream author of rcov is Mauricio Fer-
All the option descriptions have mainly be taken from the help output of rcov.
rcov 0.8.1.2 2007-11-22 27 April 2008 rcov(1)