The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
rcov 0.4.0: more accurate code coverage, scriptability, unrotten internals

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
rcov 0.4.0: more accurate code coverage, scriptability, unrotten internals Posted: May 22, 2006 4:50 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: rcov 0.4.0: more accurate code coverage, scriptability, unrotten internals
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

rcov 0.4.0 is really feature-packed, and (hopefully) less buggy than previous releases. This can be ascribed in large part to the use of rcov on itself to achieve better test coverage. Download it from rcov: code coverage for Ruby.

The looks

Starting with the most obvious changes, the XHTML output looks much better now with the new color-scheme. Plain text output formats have also improved considerably. Take a look at this sample report and compare the following screenshots to those from version 0.2.0: typo-summary.png typo-detailed.png

Scriptability and automation with Rake

rcov 0.4.0 is much easier to use from external scripts, and invoking rcov from your Rakefile takes no effort with the included Rcov::RcovTask; it can take as little as:

   require 'rcov/rcovtask'
   Rcov::RcovTask.new

Really! This creates a task named "rcov" which will run the tests matching test/test*.rb and create a XHTML report. And a nice textual report on stdout). And a clobber_rcov task, which the main clobber target will depend on, to delete the former.

However, sometimes that lone Rcov::RcovTask.new will not suffice; this would be a more realistic example:

   # if you don't like the default description
   desc "Analyze code coverage of the unit tests." 
   Rcov::RcovTask.new do |t|
     # change the glob pattern in the next line
     t.test_files = FileList['test/test*.rb'] 
     t.rcov_opts << "--sort coverage"   # sort by increasing coverage rate
   end

By default, RcovTasks will show a text report resembling


Read more...

Read: rcov 0.4.0: more accurate code coverage, scriptability, unrotten internals

Topic: Quickly Generate Random Dates in Ruby Previous Topic   Next Topic Topic: Podcast Transcripts

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use