Sha256: e4c91f11e78e7964e155195c501810f66c29dbc1f60adf12a36b21853abca402

Contents?: true

Size: 868 Bytes

Versions: 21

Compression:

Stored size: 868 Bytes

Contents

require 'nokogiri'
require 'date'

module Slather
  module CoverageService
    module LlvmCovOutput

      def coverage_file_class
        if input_format == "profdata"
          Slather::ProfdataCoverageFile
        else
          raise StandardError, "Only profdata input format supported by llvm-cov show."
        end
      end
      private :coverage_file_class

      def post
        report = coverage_files.map do |file|
          ["#{file.source_file_pathname.realpath}:", file.source_data, ""]
        end.flatten.join("\n")

        store_report(report)
      end

      def store_report(report)
        output_file = 'report.llcov'
        if output_directory
          FileUtils.mkdir_p(output_directory)
          output_file = File.join(output_directory, output_file)
        end
        File.write(output_file, report.to_s)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
slather-2.8.5 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.8.4 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.8.3 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.8.2 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.8.1 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.8.0 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.5 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.4 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.3 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.2 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.1 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.7.0 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.6.1 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.6.0 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.5.0 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.4.9 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.4.8 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.4.7 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.4.6 lib/slather/coverage_service/llvm_cov_output.rb
slather-2.4.5 lib/slather/coverage_service/llvm_cov_output.rb