debian-mirror-gitlab/scripts/merge-simplecov
2021-06-08 01:23:25 +05:30

30 lines
635 B
Ruby
Executable file

#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../spec/simplecov_env'
SimpleCovEnv.configure_profile
SimpleCovEnv.configure_formatter
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|
JSON.parse(File.read(path))
rescue StandardError
{}
end
end
def resultset
resultset_hashes.reduce({}, :merge)
end
end
end
end
SimpleCov::ResultMerger.merged_result.format!