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-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Jim Deville
Sent: Monday, March 08, 2010 11:25 AM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] RCov

Interesting to know though. Thanks for sharing!

JD

From: ironruby-core-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Shri Borde
Sent: Monday, March 08, 2010 11:14 AM
To: ironruby-core@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-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Shri Borde
Sent: Friday, January 22, 2010 10:53 AM
To: ironruby-core@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-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Jim Deville
Sent: Friday, January 22, 2010 10:34 AM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based ☹

JD

From: ironruby-core-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Ryan Riley
Sent: Friday, January 22, 2010 10:12 AM
To: ironruby-core@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.ri...@panesofglass.org<mailto:ryan.ri...@panesofglass.org>
LinkedIn: http://www.linkedin.com/in/ryanriley
Blog: http://wizardsofsmart.net/
Twitter: @panesofglass
Website: http://panesofglass.org/
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to