2016-06-30 10:08:01 -04:00
|
|
|
#!/usr/bin/env ruby
|
2021-02-12 07:09:02 -05:00
|
|
|
# frozen_string_literal: true
|
2016-06-30 10:08:01 -04:00
|
|
|
|
2016-07-21 04:44:18 -04:00
|
|
|
require_relative '../spec/simplecov_env'
|
|
|
|
SimpleCovEnv.configure_profile
|
2020-06-23 11:08:41 -04:00
|
|
|
SimpleCovEnv.configure_formatter
|
2016-06-30 10:08:01 -04:00
|
|
|
|
2016-07-21 04:25:57 -04:00
|
|
|
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-03-13 09:42:43 -04:00
|
|
|
JSON.parse(File.read(path))
|
|
|
|
rescue
|
|
|
|
{}
|
2016-07-21 04:25:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def resultset
|
|
|
|
resultset_hashes.reduce({}, :merge)
|
|
|
|
end
|
2016-06-30 10:08:01 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-07-21 04:25:57 -04:00
|
|
|
SimpleCov::ResultMerger.merged_result.format!
|