Show
added a comment - I have gone ahead and added basic support for the "coverage" lib in jruby-1_6@aaa3250 and master@6bf8b2c. It's not exactly the same, since it starts tracking all lines throughout the system once enabled, but it produces the right result for the file shown below (along with some extra stuff).
If you want to help improve it, you could contribute some specs for the "coverage" library to RubySpec. Additional missing features or bugs should be reported separately.
~/projects/jruby $ jruby --debug --1.9 -e "require 'coverage'; Coverage.start; require './blah.rb'; p Coverage.result"
{"/Users/headius/projects/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb"=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2], "/Users/headius/projects/jruby/./blah.rb"=>[1, nil, 1, 1, nil, nil, 1], "-e"=>[2]}
~/projects/jruby $ ruby1.9.2 -e "require 'coverage'; Coverage.start; require './blah.rb'; p Coverage.result"
{"/Users/headius/projects/jruby/blah.rb"=>[1, nil, 1, 1, nil, nil, 1]}
I have gone ahead and added basic support for the "coverage" lib in jruby-1_6@aaa3250 and master@6bf8b2c. It's not exactly the same, since it starts tracking all lines throughout the system once enabled, but it produces the right result for the file shown below (along with some extra stuff).
If you want to help improve it, you could contribute some specs for the "coverage" library to RubySpec. Additional missing features or bugs should be reported separately.
~/projects/jruby $ jruby --debug --1.9 -e "require 'coverage'; Coverage.start; require './blah.rb'; p Coverage.result" {"/Users/headius/projects/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb"=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2], "/Users/headius/projects/jruby/./blah.rb"=>[1, nil, 1, 1, nil, nil, 1], "-e"=>[2]} ~/projects/jruby $ ruby1.9.2 -e "require 'coverage'; Coverage.start; require './blah.rb'; p Coverage.result" {"/Users/headius/projects/jruby/blah.rb"=>[1, nil, 1, 1, nil, nil, 1]}