rcov limitation

B

Brian Adkins

When using rcov to measure the code coverage of the following:

2 Symbol.class_eval do
3 def to_proc
4 lambda {|obj, *args| obj.send(self, *args) }
5 end
6 end

it erroneously reports that lines 4 - 6 have not been executed when
executing a set of test cases via:

rake rcov

However, if I use rcov to drive only the one test case that exercises
the above code via:

rcov -I/my_lib_path tc_utility.rb

it correctly show lines 4 - 6 as being executed.

Anyone know why rcov might have a problem detecting this when running
a set of files instead of an individual?

My Rakefile includes the following for the rcov task:

lib_dir = [ File.expand_path('..') ]

Rcov::RcovTask.new do |t|
t.libs = lib_dir
t.test_files = FileList['tc_*.rb']
t.verbose = true
end

Brian Adkins
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top