Skip to content

Commit

Permalink
Merge pull request #603 from dnkoutso/code_coverage_scheme
Browse files Browse the repository at this point in the history
Add `code_coverage` support for scheme DSL.
  • Loading branch information
dnkoutso authored Oct 29, 2019
2 parents 088b3ae + 2f147b9 commit fe19e73
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

##### Enhancements

* Add `code_coverage` support for scheme DSL.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#603](https://github.com/CocoaPods/Core/pull/603)
[CocoaPods/CocoaPods#8921](https://github.com/CocoaPods/CocoaPods/issues/8921)

* Add `:configurations` DSL for podspec dependencies.
[Samuel Giddins](https://github.com/segiddins)
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-core/specification/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ def subspec(name, &block)
:types => [String],
:spec_types => [:test]

SCHEME_KEYS = [:launch_arguments, :environment_variables].freeze
SCHEME_KEYS = [:launch_arguments, :environment_variables, :code_coverage].freeze

# @!method scheme=(flag)
#
Expand Down
3 changes: 3 additions & 0 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ def _validate_scheme(s)
if s.key?(:environment_variables) && !s[:environment_variables].is_a?(Hash)
results.add_error('scheme', 'Expected a hash for key `environment_variables`.')
end
if s.key?(:code_coverage) && ![true, false].include?(s[:code_coverage])
results.add_error('scheme', 'Expected a boolean for key `code_coverage`.')
end
end
end

Expand Down
8 changes: 7 additions & 1 deletion spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ def result_should_include(*values)
#------------------#

it 'accepts valid scheme values' do
@spec.scheme = { :launch_arguments => ['Arg1'], :environment_variables => { 'Key1' => 'Val1' } }
@spec.scheme = { :launch_arguments => ['Arg1'], :environment_variables => { 'Key1' => 'Val1' },
:code_coverage => true }
@linter.lint
@linter.results.should.be.empty
end
Expand All @@ -561,6 +562,11 @@ def result_should_include(*values)
result_should_include('scheme', 'Expected a hash for key `environment_variables`.')
end

it 'checks scheme code coverage key type' do
@spec.scheme = { :code_coverage => 1 }
result_should_include('scheme', 'Expected a boolean for key `code_coverage`.')
end

#------------------#

it 'accepts valid frameworks' do
Expand Down

0 comments on commit fe19e73

Please sign in to comment.