JRuby 1.9 coverage library reports different results than ruby 1.9 ------------------------------------------------------------------
Key: JRUBY-6106 URL: https://jira.codehaus.org/browse/JRUBY-6106 Project: JRuby Issue Type: Bug Components: Ruby 1.9.2 Affects Versions: JRuby 1.6.4 Environment: Ubuntu 11.04, jruby 1.6.4 (ruby-1.9.2-p136) (2011-08-23 17ea768) (OpenJDK Client VM 1.6.0_22) [linux-i386-java], ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] Reporter: Raymond Assignee: Thomas E Enebo Priority: Minor Attachments: test_cov.rb The coverage array returned from jruby and ruby differ. Ruby marks valid code lines not covered as 0, whereas Jruby marks these same lines as nil, thus making code coverage tools not being able to distinguish between valid non-covered lines of code, and non-code lines. As you can see from the test file attached, and the output, ruby marks one line with a 0, and jruby does not. Jruby also misses the last two blank lines, but I don't see that as an issue for getting proper code coverage tools working. ruby1.9.2 -e "require 'coverage'; Coverage.start; require './test_cov.rb'; p Coverage.result" {"/home/ray/Perforce/ray_ray-desktop/Atria/test_cov.rb"=>[nil, nil, 1, 1, 1, nil, nil, nil, nil, nil, 1, nil, 0, nil, nil, nil, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1, 1, nil, nil]} jruby --debug --1.9 -e "require 'coverage'; Coverage.start; require './test_cov.rb'; p Coverage.result" {"/home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/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, 1], "/home/ray/Perforce/ray_ray-desktop/Atria/./test_cov.rb"=>[nil, nil, 1, 1, 1, nil, nil, nil, nil, nil, 1, nil, nil, nil, nil, nil, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1, 1], "-e"=>[2]} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email