Skip to content

Commit

Permalink
enable code coverage
Browse files Browse the repository at this point in the history
It is so low as to make anyone cry ... but it is better to face the
truth than to ignore it
  • Loading branch information
doudou committed Sep 18, 2015
1 parent d08df08 commit 1c54412
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ doc/guide/src/autoproj_bootstrap
pkg/
/vendor/
/.bundle
/coverage/
1 change: 1 addition & 0 deletions autoproj.gemspec
Expand Up @@ -24,5 +24,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "flexmock", ">= 2.0.0"
s.add_development_dependency "minitest", ">= 5.0", "~> 5.0"
s.add_development_dependency "fakefs"
s.add_development_dependency "simplecov"
end

8 changes: 5 additions & 3 deletions lib/autoproj/test.rb
Expand Up @@ -3,12 +3,14 @@
if ENV['TEST_ENABLE_COVERAGE'] == '1'
begin
require 'simplecov'
SimpleCov.start
SimpleCov.start do
add_filter "/test/"
end
rescue LoadError
require 'dummy_project'
require 'autoproj'
Autoproj.warn "coverage is disabled because the 'simplecov' gem cannot be loaded"
rescue Exception => e
require 'dummy_project'
require 'autoproj'
Autoproj.warn "coverage is disabled: #{e.message}"
end
end
Expand Down

0 comments on commit 1c54412

Please sign in to comment.