Welcome to mirror list, hosted at ThFree Co, Russian Federation.

merge-simplecov « scripts - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 746be3317a7df3b0932e70cd30edae60a3ec6664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby

require_relative '../spec/simplecov_env'
SimpleCovEnv.configure_profile

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
          {}
        end
      end

      def resultset
        resultset_hashes.reduce({}, :merge)
      end
    end
  end
end

SimpleCov::ResultMerger.merged_result.format!