Sha256: c6c01b4ebcc29edc6421a384bd1d1b4d651d98e975b94a3c34a107cf0ce438c8

Contents?: true

Size: 1.39 KB

Versions: 13

Compression:

Stored size: 1.39 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')

describe Slather::CoverageService::LlvmCovOutput do

  let(:fixtures_project) do
    proj = Slather::Project.open(FIXTURES_PROJECT_PATH)
    proj.build_directory = TEMP_DERIVED_DATA_PATH
    proj.binary_basename = ["fixturesTests", "libfixturesTwo"]
    proj.input_format = "profdata"
    proj.coverage_service = "llvm_cov"
    proj.configure
    proj
  end

  describe '#coverage_file_class' do
    it "should return ProfdataCoverageFile" do
      expect(fixtures_project.send(:coverage_file_class)).to eq(Slather::ProfdataCoverageFile)
    end
  end

  describe '#post' do
    it "should create an llvm-cov report spanning all coverage files" do
      fixtures_project.post

      output_llcov = File.read('report.llcov')
      fixture_llcov = File.read(FIXTURES_LLCOV_PATH)

      output_llcov, fixture_llcov = [output_llcov, fixture_llcov].map do |llcov_doc|
        llcov_doc.gsub(/^\/.+:$/, '')
      end

      expect(output_llcov).to eq(fixture_llcov)
      FileUtils.rm('report.llcov')
    end

    it "should create an llvm-cov report in the given output directory" do
      fixtures_project.output_directory = "./output"
      fixtures_project.post

      filepath = "#{fixtures_project.output_directory}/report.llcov"
      expect(File.exists?(filepath)).to be_truthy

      FileUtils.rm_rf(fixtures_project.output_directory)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
slather-2.7.3 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.7.2 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.7.1 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.7.0 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.6.1 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.6.0 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.5.0 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.9 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.8 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.7 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.6 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.5 spec/slather/coverage_service/llvm_cov_spec.rb
slather-2.4.4 spec/slather/coverage_service/llvm_cov_spec.rb