Commit 6d6d6bb3 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7027 from justinseanmartin/jmartin/dont-codesign-osx-test-targets

Don't codesign :osx test targets
parents 087e894f 148348bf
......@@ -30,7 +30,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Ensure a unique ID is generated for each resource bundle
* Do not code sign OSX targets for testing bundles
[Justin Martin](https://github.com/justinseanmartin)
[#7027](https://github.com/CocoaPods/CocoaPods/pull/7027)
* Ensure a unique ID is generated for each resource bundle
[Justin Martin](https://github.com/justinseanmartin)
[#7015](https://github.com/CocoaPods/CocoaPods/pull/7015)
......
......@@ -199,8 +199,8 @@ module Pod
# requires frameworks. For tests we always use the test target name as the product name
# irrelevant to whether we use frameworks or not.
configuration.build_settings['PRODUCT_NAME'] = name
# We need to codesign the contents of xctest bundles for Xcode to allow them to be launchable
configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'YES'
# We must codesign iOS XCTest bundles that contain binary frameworks to allow them to be launchable in the simulator
configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'YES' unless target.platform == :osx
end
# Test native targets also need frameworks and resources to be copied over to their xctest bundle.
......
......@@ -143,11 +143,16 @@ module Pod
before do
config.sandbox.prepare
@podfile = Podfile.new do
platform :ios, '6.0'
project 'SampleProject/SampleProject'
target 'SampleProject'
target 'SampleProject' do
platform :ios, '6.0'
end
target 'SampleProject2' do
platform :osx, '10.8'
end
end
@target_definition = @podfile.target_definitions['SampleProject']
@target_definition2 = @podfile.target_definitions['SampleProject2']
@project = Project.new(config.sandbox.project_path)
config.sandbox.project = @project
......@@ -179,9 +184,13 @@ module Pod
@coconut_pod_target.file_accessors = [file_accessor, test_file_accessor]
@coconut_pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = PodTargetInstaller.new(config.sandbox, @coconut_pod_target)
@coconut_pod_target2 = PodTarget.new([@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition2], config.sandbox)
@coconut_pod_target2.file_accessors = [file_accessor, test_file_accessor]
@coconut_pod_target2.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer2 = PodTargetInstaller.new(config.sandbox, @coconut_pod_target2)
end
it 'adds the native test target to the project' do
it 'adds the native test target to the project for iOS targets with code signing' do
@installer.install!
@project.targets.count.should == 2
@project.targets.first.name.should == 'CoconutLib'
......@@ -196,6 +205,21 @@ module Pod
@coconut_pod_target.test_native_targets.count.should == 1
end
it 'adds the native test target to the project for OSX targets without code signing' do
@installer2.install!
@project.targets.count.should == 2
@project.targets.first.name.should == 'CoconutLib'
native_test_target = @project.targets[1]
native_test_target.name.should == 'CoconutLib-Unit-Tests'
native_test_target.product_reference.name.should == 'CoconutLib-Unit-Tests'
native_test_target.build_configurations.each do |bc|
bc.build_settings['PRODUCT_NAME'].should == 'CoconutLib-Unit-Tests'
bc.build_settings['CODE_SIGNING_REQUIRED'].should.be.nil
end
native_test_target.symbol_type.should == :unit_test_bundle
@coconut_pod_target2.test_native_targets.count.should == 1
end
it 'adds swiftSwiftOnoneSupport ld flag to the debug configuration' do
@coconut_pod_target.stubs(:uses_swift?).returns(true)
@installer.install!
......
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