debian-mirror-gitlab/scripts/merge-simplecov

30 lines
591 B
Text
Raw Normal View History

2016-09-13 17:45:13 +05:30
#!/usr/bin/env ruby
require_relative '../spec/simplecov_env'
SimpleCovEnv.configure_profile
2020-07-28 23:09:34 +05:30
SimpleCovEnv.configure_formatter
2016-09-13 17:45:13 +05:30
module SimpleCov
module ResultMerger
class << self
def resultset_files
Dir.glob(File.join(SimpleCov.coverage_path, '*', '.resultset.json'))
end
def resultset_hashes
resultset_files.map do |path|
2019-05-18 00:54:41 +05:30
JSON.parse(File.read(path))
rescue
{}
2016-09-13 17:45:13 +05:30
end
end
def resultset
resultset_hashes.reduce({}, :merge)
end
end
end
end
SimpleCov::ResultMerger.merged_result.format!