public
Description: Home has moved to http://github.com/relevance/rcov
Homepage: http://github.com/relevance/rcov
Clone URL: git://github.com/spicycode/rcov.git
rcov /
name age message
file .gitignore Fri Sep 12 07:40:40 -0700 2008 Updating git ignore, fixing gemspec to referenc... [spicycode]
file BLURB Fri Sep 12 07:40:40 -0700 2008 Updating git ignore, fixing gemspec to referenc... [spicycode]
file CHANGES Thu Nov 22 02:52:35 -0800 2007 CHANGES, THANKS: updated. darcs-hash:200711221... [mfp]
file LEGAL Sat Jan 26 07:32:11 -0800 2008 bin/rcov, lib/rcov/report.rb, xx.rb: get rid of... [mfp]
file LICENSE Sat Feb 25 01:42:52 -0800 2006 bin/rcov: Moved xx to rcov's DATA area. Updated... [mfp]
file README.markdown Mon Mar 02 17:18:42 -0800 2009 [spicycode]
file Rakefile Loading commit data...
file Rantfile Fri Sep 12 07:40:40 -0700 2008 Updating git ignore, fixing gemspec to referenc... [spicycode]
file THANKS Thu Nov 22 02:52:35 -0800 2007 CHANGES, THANKS: updated. darcs-hash:200711221... [mfp]
directory bin/ Wed Oct 29 18:33:17 -0700 2008 --spec-only works on latest rspec!!! [spicycode]
file changelog Wed Oct 29 18:33:17 -0700 2008 --spec-only works on latest rspec!!! [spicycode]
directory ext/ Sun Aug 31 06:00:41 -0700 2008 Merge branch 'master' of git://github.com/spicy... [Jay McGaffigan]
directory lib/ Thu Mar 12 20:19:38 -0700 2009 trying to rev gemspec to force a gem rebuild [rsanheim]
file rcov-jruby.off Mon Mar 02 17:19:52 -0800 2009 move jruby gemspec for now Signed-off-by: Chad... [rsanheim]
file rcov.el Sun Dec 17 00:40:40 -0800 2006 rcov.el: added provide darcs-hash:200612170840... [rubikitch]
file rcov.gemspec
file rcov.vim Sat Jun 10 03:49:28 -0700 2006 rcov.vim, README.vim, CHANGES: vim support for ... [mfp]
file readme_for_api Fri Sep 12 07:40:40 -0700 2008 Updating git ignore, fixing gemspec to referenc... [spicycode]
file readme_for_emacs Mon Sep 01 14:21:18 -0700 2008 Readme cleanup [spicycode]
file readme_for_rake Mon Sep 01 14:21:18 -0700 2008 Readme cleanup [spicycode]
file readme_for_rant Mon May 29 05:08:21 -0700 2006 README.rant: fixed formatting. darcs-hash:2006... [mfp]
file readme_for_vim Fri Sep 12 07:40:40 -0700 2008 Updating git ignore, fixing gemspec to referenc... [spicycode]
file setup.rb Wed Jul 30 12:52:53 -0700 2008 update to Rake for suporting gems [Jay McGaffigan]
directory test/ Mon Mar 02 17:19:43 -0800 2009 working on Github gem; remove rubygems 1.2 requ... [rsanheim]
README.markdown

RCov - Code Coverage for Ruby

Why? What?

This is my fork of Mauricio Fernandez's RCov (maintained by Relevance).

Why does this fork exist?

  • working on 100% stability with Ruby 1.8.6 -- there are numerous segfaults and crashes that have been fixed, and we are trying to fix more
  • Ruby 1.9 support -- still very much a work in progress in a branch
  • support for other runtimes/platforms, such as JRuby and win32

INSTALL

gem install spicycode-rcov --source http://gems.github.com

BUGS? ISSUES?

Go to http://relevance.lighthouseapp.com/projects/16869-rcov/overview

Original, More Detailed Readme Below

rcov copyright (c) 2004-2006 Mauricio Fernandez mfp@acm.org

rcov includes xx 0.1.0, copyright (c) 2005, ePark Labs, Inc. and contributors

rcov README

Rcov is a code coverage tool for Ruby. It is commonly used for viewing overall test coverage of target code. It features:

  • fast execution: 20-300 times faster than previous tools
  • multiple analysis modes: standard, bogo-profile, "intentional testing", dependency analysis...
  • detection of uncovered code introduced since the last run ("differential code coverage")
  • fairly accurate coverage information through code linkage inference using simple heuristics
  • cross-referenced XHTML and several kinds of text reports
  • support for easy automation with Rake and Rant
  • colorblind-friendliness

Requirements

  • Ruby 1.8
  • (recommended) C compiler: you can also use rcov without the rcovrt extension but rcov will be two orders of magnitude slower. The extension requires Ruby 1.8.3 or later. If you're on win32, you can find a pre-built rcovrt extension at http://eigenclass.org/hiki.rb?rcov

Normal install

De-compress the archive and enter its top directory. Then type:

($ su)
 # ruby setup.rb

This simple step installs rcov under the default location for Ruby libraries. You can also customize the installation by supplying some options to setup.rb. Try "ruby setup.rb --help".

A normal (rcovrt-enabled) install requires Ruby >= 1.8.3 and a working C toolchain; if you cannot compile Ruby extensions proceed as described below.

If you're on win32, you can find a pre-built rcovrt extension at http://eigenclass.org/hiki.rb?rcov

You might have to install a "development package" (often named ruby-dev or ruby1.8-dev), or alternatively build ruby from the sources, if the compiler cannot find the headers (ruby.h and friends).

Install without the rcovrt extension

($su )
# ruby setup.rb all --without-ext

will install rcov without building the rcovrt extension.

Usage

In the common scenario, your tests are under test/ and the target code (whose coverage you want) is in lib/. In that case, all you have to do is use rcov to run the tests (instead of testrb), and a number of XHTML files with the code coverage information will be generated, e.g.

rcov -Ilib test/*.rb

will execute all the .rb files under test/ and generate the code coverage report for the target code (i.e. for the files in lib/) under coverage/. The target code needs not be under lib/; rcov will detect is as long as it is require()d by the tests. rcov is smart enough to ignore "uninteresting" files: the tests themselves, files installed in Ruby's standard locations, etc. See rcov --help for the list of regexps rcov matches filenames against.

rcov can also be used from Rake; see readme_for_rake or the RDoc documentation for more information. The Rakefile included in rcov's sources holds a few tasks that run rcov on itself, producing a number of reports. You can try

rake rcov

preferably after a full install or

ruby setup.rb config
ruby setup.rb setup

so that the rcovrt extension can be used to speed up the process. This will generate a cross-referenced XHTML report under coverage/.

rcov can output information in several formats, and perform different kinds of analyses in addition to plain code coverage. See rcov --help for a description of the available options.

License

rcov is licensed under the same terms as Ruby. See LICENSE. rcov includes a copy of the xx library, which carries the following copyright notice:

ePark Labs Public License version 1 Copyright (c) 2005, ePark Labs, Inc. and contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of ePark Labs nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Relevace OSS swat team opensource@thinkrelevance.com

Mauricio Fernandez mfp@acm.org