debian-mirror-gitlab/scripts/merge-simplecov

31 lines
635 B
Text
Raw Normal View History

2016-09-13 17:45:13 +05:30
#!/usr/bin/env ruby
2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
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-07-07 11:18:12 +05:30
JSON.parse(File.read(path))
2021-06-08 01:23:25 +05:30
rescue StandardError
2019-07-07 11:18:12 +05:30
{}
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!