Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code_coverage support for scheme DSL. #603

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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