# RCov

**URL:** <https://www.ruby-forum.com/t/rcov/182108>\
**Category:** IronRuby\
**Created:** [January 22, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/rcov/182108 "2010-01-22T19:12:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [January 22, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/rcov/182108/1 "2010-01-22T19:12:14Z")

</div>

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

Ryan R.

Email: removed\_email\_address@domain.invalid  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [January 22, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/rcov/182108/2 "2010-01-22T19:38:00Z")

</div>

I think rcov is c-based â˜¹

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Friday, January 22, 2010 10:12 AM  
To: removed\_email\_address@domain.invalid  
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 R.

Email: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [January 22, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/rcov/182108/3 "2010-01-22T19:54:23Z")

</div>

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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Friday, January 22, 2010 10:34 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based â˜¹

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Friday, January 22, 2010 10:12 AM  
To: removed\_email\_address@domain.invalid  
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 R.

Email: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [January 22, 2010, 9:06pm UTC](https://www.ruby-forum.com/t/rcov/182108/4 "2010-01-22T21:06:59Z")

</div>

That’s what I thought. Thanks for the responses.

Ryan R.

Email: removed\_email\_address@domain.invalid  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 8, 2010, 8:14pm UTC](https://www.ruby-forum.com/t/rcov/182108/5 "2010-03-08T20:14:39Z")

</div>

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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Friday, January 22, 2010 10:53 AM  
To: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Friday, January 22, 2010 10:34 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based â˜¹

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Friday, January 22, 2010 10:12 AM  
To: removed\_email\_address@domain.invalid  
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 R.

Email: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 8, 2010, 8:31pm UTC](https://www.ruby-forum.com/t/rcov/182108/6 "2010-03-08T20:31:03Z")

</div>

Interesting to know though. Thanks for sharing!

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Monday, March 08, 2010 11:14 AM  
To: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Friday, January 22, 2010 10:53 AM  
To: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Friday, January 22, 2010 10:34 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based â˜¹

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Friday, January 22, 2010 10:12 AM  
To: removed\_email\_address@domain.invalid  
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 R.

Email: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 11, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/rcov/182108/7 "2010-03-11T19:15:20Z")

</div>

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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Monday, March 08, 2010 11:25 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] RCov

Interesting to know though. Thanks for sharing!

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Monday, March 08, 2010 11:14 AM  
To: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Friday, January 22, 2010 10:53 AM  
To: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Friday, January 22, 2010 10:34 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] RCov

I think rcov is c-based â˜¹

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Friday, January 22, 2010 10:12 AM  
To: removed\_email\_address@domain.invalid  
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 R.

Email: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)
