[Ironruby-core] RCov

Shri Borde Shri.Borde at microsoft.com
Thu Mar 11 13:14:39 EST 2010


Any guesses what this code prints?

SCRIPT_LINES__ = {}
require "rubygems"
puts SCRIPT_LINES__.size

If you thought 0 like me, you are wrong. Its prints 31 with MRI. I was trying to get IronRuby to work with rcov in the pure Ruby mode, and was completely baffled why it was not working for IronRuby. Turns out SCRIPT_LINES__ is a magic constant that contains the mapping from the names of all the loaded files to their content. There is a comment about it in the IronRuby sources, but it is an unimplemented feature. The pure-Ruby RCov mode depends on this, and so it does not work with IronRuby.

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville
Sent: Monday, March 08, 2010 11:25 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] RCov

Interesting to know though. Thanks for sharing!

JD

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde
Sent: Monday, March 08, 2010 11:14 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] RCov

Just noticed that RCov can work in pure Ruby mode without the C-based core known as “rcovrt”. The pure Ruby mode is two orders of magnitude slower. Just FYI. There is still the issue that it will not profile .NET code…

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde
Sent: Friday, January 22, 2010 10:53 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] RCov

The core is C-based. Most of it is in Ruby. This is just similar to ruby-debug which also has a small C-based core. Both would need a small hook from IronRuby. So its certainly feasible to support it, but at this point, it will be post-1.0

However, you would only get coverage for Ruby code. For profiling .NET code, you have to use .NET profilers like the one in VS.

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville
Sent: Friday, January 22, 2010 10:34 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based ☹

JD

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley
Sent: Friday, January 22, 2010 10:12 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] RCov

I know everyone is using IronRuby for their testing, but what about code coverage? Has anyone tried RCov with a .NET app?


Ryan Riley

Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>
LinkedIn: http://www.linkedin.com/in/ryanriley
Blog: http://wizardsofsmart.net/
Twitter: @panesofglass
Website: http://panesofglass.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100311/8b1c946f/attachment.html>


More information about the Ironruby-core mailing list