From: Mat Schaffer Date: 2006-06-01T22:25:11+09:00 Subject: Re: [ANN] rcov 0.5.0: code coverage + callsite info, RubyGems, Rant... On Jun 1, 2006, at 4:56 AM, Mauricio Fernandez wrote: > I don't know about eclipse, but I implemented this yesterday: > > $ rake rcov RCOVOPTS="--save" > [...] > > /me edits lib/rcov.rb > > ... some time later: > > $ rake rcov RCOVOPTS="--text-coverage-diff --no-color" > (in /home/batsman/src/rcov/head) > rm -r coverage > /home/batsman/usr/bin/ruby -Ilib:ext/rcovrt "bin/rcov" --text- > coverage-diff --no-color -o "coverage" "test/ > test_CodeCoverageAnalyzer.rb" "test/test_FileStatistics.rb" "test/ > test_CallSiteAnalyzer.rb" > Loaded suite bin/rcov > Started > ....................................... > Finished in 1.163085 seconds. > > 39 tests, 415 assertions, 0 failures, 0 errors > > ====================================================================== > ========== > !!!!! Uncovered code introduced in lib/rcov.rb > > ### lib/rcov.rb:207 > > def precompute_coverage(comments_run_by_default = true) > changed = false > lastidx = lines.size - 1 > if (!is_code?(lastidx) || /^__END__$/ =~ @lines[-1]) && ! > @coverage[lastidx] > !! # mark the last block of comments > !! @coverage[lastidx] ||= :inferred > !! (lastidx-1).downto(0) do |i| > !! break if is_code?(i) > !! @coverage[i] ||= :inferred > !! end > !! end > (0...lines.size).each do |i| > next if @coverage[i] > line = @lines[i] > > It's in my repository, and it will be in rcov 0.6.0. Bravo! What's your encore gonna be? I'm no expert in eclipse plugins. And actually the editor is a little hard to plug from what I understand. But if there's a way to get those !! lines in a lightweight machine readable format, it shouldn't be _too_ hard to implement the functionality I was talking about. -Mat