Permalink
Browse files

Add simplecov-rcov setup to the test suite so jenkins can parse the c…

…ode coverage metrics.
  • Loading branch information...
1 parent 48c26e5 commit bd9aa03fc4142b27dca4314ce07c6ec0b769bc71 @dazoakley committed Oct 31, 2011
Showing with 28 additions and 11 deletions.
  1. +2 −0 Gemfile.lock
  2. +9 −8 biomart.gemspec
  3. +17 −3 test/test_helper.rb
View
@@ -16,6 +16,7 @@ GEM
simplecov (0.4.0)
simplecov-html (~> 0.4.0)
simplecov-html (0.4.3)
+ simplecov-rcov (0.2.0)
vcr (1.7.2)
webmock (1.6.2)
addressable (>= 2.2.2)
@@ -31,6 +32,7 @@ DEPENDENCIES
rake
shoulda (>= 2.10)
simplecov
+ simplecov-rcov
vcr
webmock
yard
View
@@ -19,12 +19,13 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency("builder", [">= 3.0"])
- s.add_development_dependency("rake", [">= 0"])
- s.add_development_dependency("shoulda", [">= 2.10"])
- s.add_development_dependency("simplecov", [">= 0"])
- s.add_development_dependency("awesome_print", [">= 0"])
- s.add_development_dependency("vcr", [">= 0"])
- s.add_development_dependency("webmock", [">= 0"])
- s.add_development_dependency("yard", [">= 0"])
+ s.add_runtime_dependency "builder", [">= 3.0"]
+ s.add_development_dependency "rake"
+ s.add_development_dependency "shoulda", [">= 2.10"]
+ s.add_development_dependency "simplecov"
+ s.add_development_dependency "simplecov-rcov"
+ s.add_development_dependency "awesome_print"
+ s.add_development_dependency "vcr"
+ s.add_development_dependency "webmock"
+ s.add_development_dependency "yard"
end
View
@@ -6,9 +6,23 @@
# Set-up SimpleCov (code coverage tool for Ruby 1.9)
if /^1.9/ === RUBY_VERSION
- require 'simplecov'
- SimpleCov.start do
- coverage_dir 'simplecov'
+ begin
+ require 'simplecov'
+ require 'simplecov-rcov'
+
+ class SimpleCov::Formatter::MergedFormatter
+ def format(result)
+ SimpleCov::Formatter::HTMLFormatter.new.format(result)
+ SimpleCov::Formatter::RcovFormatter.new.format(result)
+ end
+ end
+
+ SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
+ SimpleCov.start do
+ add_filter "/test/"
+ end
+ rescue LoadError
+ puts "[ERROR] Unable to load 'simplecov' - please run 'bundle install'"
end
end

0 comments on commit bd9aa03

Please sign in to comment.