SameShirtEveryDay.com

Personal blog of the one called Alex Gorbatchev, from Toronto, Canada.

False positives in rcov

Posted on April 18th, 2009 by Alex Gorbatchev. Tagged with , , , . In Ruby. No comments yet...

rcov_false_positives

I noticed that depending on the syntax used, rcov (0.8.1.2.0 win32) can give false positives. For example, when putting blocks on the same line as methods that execute them, if the method was called and block wasn’t, the line would still be colored as “covered”.

In the image above you can see that line #23 isn’t covered, where as #28 is. Problem is, I don’t have any tests yet hitting XML portion.

What’s even more interesting is that using { } syntax on multiple lines gives false positives just the same – you have to use do/end syntax specifically. Only, and only then rcov will process the block correctly.

Something to keep in mind.

Update: I have tested this on OSX and the issue is exactly the same.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet, be the first one!

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> , rel="nofollow" in use - no link dropping, no keywords or domains as names; do not spam, and do not advertise!

home
Subscribe to this blog Follow me on Twitter My bookmarks on Delicious My photography on Flickr