Class: Pod::Command::Lib::Coverage

Inherits:
Pod::Command::Lib show all
Defined in:
lib/pod/command/lib/coverage.rb

Instance Method Summary collapse

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pod/command/lib/coverage.rb', line 18

def run
  test_with_coverage

  Pod::Command::Lib::Testing.handle_workspaces_in_dir(Pathname.pwd) do |workspace, _path|
    workspace.file_references.each do |file_ref|
      next unless file_ref.path.end_with? '.xcodeproj'
      next if file_ref.path == 'Pods/Pods.xcodeproj'
      slather(file_ref.path)
    end
  end
end

#slather(project_path) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/pod/command/lib/coverage.rb', line 30

def slather(project_path)
  return if not File.directory?(project_path)
  project = Slather::Project.open(project_path)

  if ENV['TRAVIS'] == 'true'
    project.coverage_service = :coveralls
  else
    project.coverage_service = :terminal
  end

  project.post

  project.coverage_service = :gutter_json
  project.post
end

#test_with_coverageObject



46
47
48
49
50
51
# File 'lib/pod/command/lib/coverage.rb', line 46

def test_with_coverage
  args = CLAide::ARGV.new(['GCC_GENERATE_TEST_COVERAGE_FILES=YES',
                           'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES'])
  tester = Pod::Command::Lib::Testing.new(args)
  tester.run
end