Module: Slather::CoverageService::LlvmCovOutput

Defined in:
lib/slather/coverage_service/llvm_cov_output.rb

Instance Method Summary collapse

Instance Method Details

#postObject



17
18
19
20
21
22
23
# File 'lib/slather/coverage_service/llvm_cov_output.rb', line 17

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

  store_report(report)
end

#store_report(report) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/slather/coverage_service/llvm_cov_output.rb', line 25

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