From 8f4e1409880d305b383034a8dada95b25fe22894 Mon Sep 17 00:00:00 2001 From: Chris Ortman Date: Wed, 19 Oct 2016 22:18:31 -0500 Subject: [PATCH] Adds failing test for #5514 --- .../xcconfig/aggregate_xcconfig_spec.rb | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb b/spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb index aab87d23fa..0ebcb516ff 100644 --- a/spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb +++ b/spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb @@ -15,11 +15,13 @@ def pod_target(spec, target_definition) before do @target_definition = fixture_target_definition @specs = specs - @specs.first.user_target_xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' } - @specs.first.pod_target_xcconfig = { 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' } + @specs.first.user_target_xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' } unless @specs.empty? + @specs.first.pod_target_xcconfig = { 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' } unless @specs.empty? @pod_targets = @specs.map { |spec| pod_target(spec, @target_definition) } @target = fixture_aggregate_target(@pod_targets, @target_definition) - @target.target_definition.whitelist_pod_for_configuration(@specs.first.name, 'Release') + unless @specs.empty? + @target.target_definition.whitelist_pod_for_configuration(@specs.first.name, 'Release') + end @generator = AggregateXCConfig.new(@target, 'Release') end @@ -130,6 +132,7 @@ def pod_target(spec, target_definition) it 'links the pod targets with the aggregate target' do @xcconfig.to_hash['OTHER_LDFLAGS'].should.include '-l"BananaLib-Pods"' end + end describe 'with an unscoped pod target' do @@ -398,6 +401,31 @@ def specs end end end + + describe 'an empty pod target' do + + before do + @blank_target = fixture_aggregate_target + @generator = AggregateXCConfig.new(@blank_target, 'Release') + end + + it 'it should not have any framework search paths' do + @xcconfig = @generator.generate + @xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.be.nil + end + + describe 'with inherited targets' do + + it 'should include inherited search paths' do + # It's the responsibility of the analyzer to + # populate this when the file is loaded. + @blank_target.search_paths_aggregate_targets = [@target] + @xcconfig = @generator.generate + @xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.be.nil + + end + end + end end end end