Commit c03be4b6 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge pull request #1900 from pietbrauer/fix_whitespace_in_target_installer_specs

Convert indention into spaces instead of tabs
parents df204f8b 9b78482a
...@@ -50,7 +50,7 @@ module Pod ...@@ -50,7 +50,7 @@ module Pod
@project.targets.first.name.should == 'Pods-BananaLib' @project.targets.first.name.should == 'Pods-BananaLib'
end end
it "sets VALIDATE_PRODUCT to YES for the Release configuration for iOS targets" do it "sets VALIDATE_PRODUCT to YES for the Release configuration for iOS targets" do
@installer.install! @installer.install!
target = @project.targets.first target = @project.targets.first
target.build_settings('Release')["VALIDATE_PRODUCT"].should == "YES" target.build_settings('Release')["VALIDATE_PRODUCT"].should == "YES"
...@@ -147,91 +147,91 @@ module Pod ...@@ -147,91 +147,91 @@ module Pod
dummy = config.sandbox.root + 'Pods-BananaLib-dummy.m' dummy = config.sandbox.root + 'Pods-BananaLib-dummy.m'
dummy.read.should.include?('@interface PodsDummy_Pods') dummy.read.should.include?('@interface PodsDummy_Pods')
end end
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
describe "concerning compiler flags" do describe "concerning compiler flags" do
before do before do
@spec = Pod::Spec.new @spec = Pod::Spec.new
end end
it "flags should not be added to dtrace files" do it "flags should not be added to dtrace files" do
@installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true) @installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true)
@installer.install! @installer.install!
dtrace_files = @installer.library.target.source_build_phase.files.reject {|sf| dtrace_files = @installer.library.target.source_build_phase.files.reject {|sf|
!(File.extname(sf.file_ref.path) == '.d') !(File.extname(sf.file_ref.path) == '.d')
} }
dtrace_files.each do |dt| dtrace_files.each do |dt|
dt.settings.should.be.nil dt.settings.should.be.nil
end end
end end
it "adds -w per pod if target definition inhibits warnings for that pod" do it "adds -w per pod if target definition inhibits warnings for that pod" do
@installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true) @installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true)
flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
flags.should.include?('-w') flags.should.include?('-w')
end end
it "doesn't inhibit warnings by default" do it "doesn't inhibit warnings by default" do
flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
flags.should.not.include?('-w') flags.should.not.include?('-w')
end end
it "adds -Xanalyzer -analyzer-disable-checker per pod" do it "adds -Xanalyzer -analyzer-disable-checker per pod" do
@installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true) @installer.library.target_definition.stubs(:inhibits_warnings_for_pod?).returns(true)
flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
flags.should.include?('-Xanalyzer -analyzer-disable-checker') flags.should.include?('-Xanalyzer -analyzer-disable-checker')
end end
it "doesn't inhibit analyzer warnings by default" do it "doesn't inhibit analyzer warnings by default" do
flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
flags.should.not.include?('-Xanalyzer -analyzer-disable-checker') flags.should.not.include?('-Xanalyzer -analyzer-disable-checker')
end end
describe "concerning ARC before and after iOS 6.0 and OS X 10.8" do describe "concerning ARC before and after iOS 6.0 and OS X 10.8" do
it "does not do anything if ARC is *not* required" do it "does not do anything if ARC is *not* required" do
@spec.requires_arc = false @spec.requires_arc = false
@spec.ios.deployment_target = '5' @spec.ios.deployment_target = '5'
@spec.osx.deployment_target = '10.6' @spec.osx.deployment_target = '10.6'
ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx)) osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx))
ios_flags.should.not.include '-DOS_OBJECT_USE_OBJC' ios_flags.should.not.include '-DOS_OBJECT_USE_OBJC'
osx_flags.should.not.include '-DOS_OBJECT_USE_OBJC' osx_flags.should.not.include '-DOS_OBJECT_USE_OBJC'
end end
it "does *not* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and has a deployment target of >= iOS 6.0 or OS X 10.8" do it "does *not* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and has a deployment target of >= iOS 6.0 or OS X 10.8" do
@spec.requires_arc = false @spec.requires_arc = false
@spec.ios.deployment_target = '6' @spec.ios.deployment_target = '6'
@spec.osx.deployment_target = '10.8' @spec.osx.deployment_target = '10.8'
ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx)) osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx))
ios_flags.should.not.include '-DOS_OBJECT_USE_OBJC' ios_flags.should.not.include '-DOS_OBJECT_USE_OBJC'
osx_flags.should.not.include '-DOS_OBJECT_USE_OBJC' osx_flags.should.not.include '-DOS_OBJECT_USE_OBJC'
end end
it "*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required but has a deployment target < iOS 6.0 or OS X 10.8" do it "*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required but has a deployment target < iOS 6.0 or OS X 10.8" do
@spec.requires_arc = true @spec.requires_arc = true
@spec.ios.deployment_target = '5.1' @spec.ios.deployment_target = '5.1'
@spec.osx.deployment_target = '10.7.2' @spec.osx.deployment_target = '10.7.2'
ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx)) osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx))
ios_flags.should.include '-DOS_OBJECT_USE_OBJC' ios_flags.should.include '-DOS_OBJECT_USE_OBJC'
osx_flags.should.include '-DOS_OBJECT_USE_OBJC' osx_flags.should.include '-DOS_OBJECT_USE_OBJC'
end end
it "*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and *no* deployment target is specified" do it "*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and *no* deployment target is specified" do
@spec.requires_arc = true @spec.requires_arc = true
ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios)) ios_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:ios))
osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx)) osx_flags = @installer.send(:compiler_flags_for_consumer, @spec.consumer(:osx))
ios_flags.should.include '-DOS_OBJECT_USE_OBJC' ios_flags.should.include '-DOS_OBJECT_USE_OBJC'
osx_flags.should.include '-DOS_OBJECT_USE_OBJC' osx_flags.should.include '-DOS_OBJECT_USE_OBJC'
end end
end end
end end
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment