Move the COVERAGE_ENABLED condition into the Rakefile.

This commit is contained in:
Phil Ross 2017-09-23 20:28:15 +01:00
parent 288c54dc29
commit 79ce558f14
2 changed files with 6 additions and 3 deletions

View File

@ -88,6 +88,11 @@ def recurse_chmod(dir)
end
end
# Only run coverage tests on MRI. SimpleCov is supported on JRuby 9.1, but
# generates warnings. It is not supported on Rubinius.
TEST_COVERAGE = RUBY_ENGINE == 'ruby'
ENV['TEST_COVERAGE'] = TEST_COVERAGE ? '1' : '0'
desc 'Run tests using RubyDataSource with a format 1 version of TZInfo::Data, RubyDataSource with a format 2 version of TZInfo::Data and ZoneinfoDataSource'
task test: [:clean_coverage, :test_ruby_format1, :test_ruby_format2, :test_zoneinfo] do
end

View File

@ -2,9 +2,7 @@
raise 'Tests must be run with bundler, e.g. bundle exec rake test' unless defined?(Bundler)
# Only run coverage tests on MRI. SimpleCov is supported on JRuby 9.1, but
# generates warnings. It is not supported on Rubinius.
COVERAGE_ENABLED = RUBY_ENGINE == 'ruby'
COVERAGE_ENABLED = ENV['TEST_COVERAGE'] == '1'
if COVERAGE_ENABLED && defined?(COVERAGE_TYPE)
COVERAGE_NOCOV_TOKEN = if [].respond_to?(:bsearch_index)