From: Mauricio Fernandez Date: 2006-06-01T17:56:12+09:00 Subject: Re: [ANN] rcov 0.5.0: code coverage + callsite info, RubyGems, Rant... On Thu, Jun 01, 2006 at 08:10:47AM +0900, Mat Schaffer wrote: > >Seconded! I love it. Thank you bery much. My candidate for the "I > >want a Pony awards is" Some king of mashup between rcov, rake and > >ZenTest. I'd like something so that running tests became something > >akin to making a build in a static language, rcov would tell > >autotest what tests it needed to re-run based on the profiling > >information and whine heavily when you have code that's called > >isn't under test. > > > >/me hopes the lazyweb will provide! (and wishes he had proper time > >himself) > > Maybe this is what you mean (I don't know ZenTest), but how hot would > it be if someone made an eclipse plugin that did it as a continual > background task (like, did it per file every time you saved) and > popped up little "Attention" icons next to files and underlined the > parts of code that weren't getting hit by unit testing. *drools* 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. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby