Skip to content

Commit 341b08e

Browse files
committed
enable simplecov stats on AR provider and provider builds
1 parent 65921d5 commit 341b08e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Rakefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ namespace :test do
4444
if RUBY_VERSION =~ /^1.8/
4545
Rake::Task['rcov:client'].invoke
4646
Rake::Task['rcov:provider'].invoke
47+
Rake::Task['rcov:activerecord_provider'].invoke
4748
else
4849
ENV['COVERAGE'] = 'true'
4950
Rake::Task['test:client'].invoke
5051
Rake::Task['test:provider'].invoke
52+
Rake::Task['test:activerecord_provider'].invoke
5153
end
5254

5355
system("open coverage/index.html") if (PLATFORM['darwin'] if Kernel.const_defined? :PLATFORM) || (RUBY_PLATFORM =~ /darwin/ if Kernel.const_defined? :RUBY_PLATFORM)
@@ -72,6 +74,13 @@ if RUBY_VERSION =~ /^1.8/
7274
t.verbose = true
7375
t.rcov_opts = ['--aggregate coverage.data', '--text-summary']
7476
end
77+
78+
Rcov::RcovTask.new('activerecord_provider') do |t|
79+
t.libs << ['lib', 'test/activerecord_provider']
80+
t.pattern = 'test/activerecord_provider/tc_*.rb'
81+
t.verbose = true
82+
t.rcov_opts = ['--aggregate coverage.data', '--text-summary']
83+
end
7584
end
7685
end
7786

test/activerecord_provider/test_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
require 'rubygems'
2+
3+
if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.9/
4+
require 'simplecov'
5+
require 'simplecov-rcov'
6+
7+
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
8+
SimpleCov.start
9+
end
210
require 'test/unit'
311
require File.dirname(__FILE__) + '/config/connection'
412
require File.dirname(__FILE__) + '/helpers/providers'

test/provider/test_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.9/
2+
require 'simplecov'
3+
require 'simplecov-rcov'
4+
5+
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
6+
SimpleCov.start
7+
end
18
require 'oai'
29
require 'test/unit'
310

0 commit comments

Comments
 (0)