Skip to content

Commit 61e6ef7

Browse files
committed
Add coverage task
1 parent f7dd147 commit 61e6ef7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ RDoc::Task.new do |doc|
2727
doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc doc/rdoc/markup_reference.rb] - PARSER_FILES
2828
end
2929

30+
task "coverage" do
31+
cov = []
32+
e = IO.popen([FileUtils::RUBY, "-I./lib", "exe/rdoc", "-C"], &:read)
33+
e.scan(/^ *# in file (?<loc>.*)\n *(?<code>.*)|^ *(?<code>.*\S) *# in file (?<loc>.*)/) do
34+
puts "%s: %s\n" % $~.values_at(:loc, :code)
35+
end
36+
end
37+
3038
Rake::TestTask.new(:normal_test) do |t|
3139
t.verbose = true
3240
t.deps = :generate

0 commit comments

Comments
 (0)