Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.3
    • Fix Version/s: JRuby 1.6.4
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It'd be great if jruby had support for the coverage lib so that things like SimpleCov would JustWork on jruby as well.

        Activity

        Hide
        Charles Oliver Nutter 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]}
        
        Show
        Charles Oliver Nutter 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]}
        Hide
        Patrik Sundberg added a comment -

        Great, thanks!

        Show
        Patrik Sundberg added a comment - Great, thanks!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Patrik Sundberg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: