Skip to content

Commit

Permalink
Add coverage task
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 15, 2023
1 parent f7dd147 commit 61e6ef7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ RDoc::Task.new do |doc|
doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc doc/rdoc/markup_reference.rb] - PARSER_FILES
end

task "coverage" do
cov = []
e = IO.popen([FileUtils::RUBY, "-I./lib", "exe/rdoc", "-C"], &:read)
e.scan(/^ *# in file (?<loc>.*)\n *(?<code>.*)|^ *(?<code>.*\S) *# in file (?<loc>.*)/) do
puts "%s: %s\n" % $~.values_at(:loc, :code)
end
end

Rake::TestTask.new(:normal_test) do |t|
t.verbose = true
t.deps = :generate
Expand Down

0 comments on commit 61e6ef7

Please sign in to comment.