File: rcov.rake

package info (click to toggle)
ruby-innate 2013.02.21-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 848 kB
  • ctags: 622
  • sloc: ruby: 4,340; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
desc 'code coverage'
task :rcov => :clean do
  specs = Dir['spec/innate/**/*.rb']
  specs -= Dir['spec/innate/cache/common.rb']

  # we ignore adapter as this has extensive specs in rack already.
  ignore = %w[ gem rack bacon innate/adapter\.rb ]
  ignore << 'fiber\.rb' if RUBY_VERSION < '1.9'

  ignored = ignore.join(',')

  cmd = "rcov --aggregate coverage.data --sort coverage -t --%s -x '#{ignored}' %s"

  while spec = specs.shift
    puts '', "Gather coverage for #{spec} ..."
    html = specs.empty? ? 'html' : 'no-html'
    sh(cmd % [html, spec])
  end
end