Commit 690f9a56 authored by Paul Zabelin's avatar Paul Zabelin

Create a generic Info.plist file for test targets

parent 534a2bf5
......@@ -60,6 +60,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Create a generic Info.plist file for test targets
Use xcode default `PRODUCT_MODULE_NAME` for generated test targets
[Paul Zabelin](https://github.com/paulz)
[#7506](https://github.com/CocoaPods/CocoaPods/issues/7506)
......
......@@ -294,6 +294,11 @@ module Pod
create_test_target_embed_frameworks_script(test_type)
create_test_target_copy_resources_script(test_type)
# Generate vanila Info.plist for test target similar to the one xcode gererates for new test target.
# This creates valid test bundle accessible at the runtime, allowing tests to load bundle resources
# defined in podspec.
create_info_plist_file(target.info_plist_path_for_test_type(test_type), native_test_target, '1.0', target.platform, :bndl)
target.test_native_targets << native_test_target
end
end
......
......@@ -436,6 +436,15 @@ module Pod
support_files_dir + "#{test_target_label(test_type)}-frameworks.sh"
end
# @param [Symbol] test_type
# The test type this Info.plist path is for.
#
# @return [Pathname] The absolute path of the Info.plist for the given test type.
#
def info_plist_path_for_test_type(test_type)
support_files_dir + "#{test_target_label(test_type)}-Info.plist"
end
# @return [Pathname] the absolute path of the prefix header file.
#
def prefix_header_path
......
......@@ -203,6 +203,7 @@ module Pod
bc.build_settings['CODE_SIGNING_REQUIRED'].should == 'YES'
bc.build_settings['CODE_SIGNING_ALLOWED'].should == 'YES'
bc.build_settings['CODE_SIGN_IDENTITY'].should == 'iPhone Developer'
bc.build_settings['INFOPLIST_FILE'].should == 'Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
native_test_target.symbol_type.should == :unit_test_bundle
@coconut_pod_target.test_native_targets.count.should == 1
......@@ -221,6 +222,7 @@ module Pod
bc.build_settings['CODE_SIGNING_REQUIRED'].should.be.nil
bc.build_settings['CODE_SIGNING_ALLOWED'].should.be.nil
bc.build_settings['CODE_SIGN_IDENTITY'].should == ''
bc.build_settings['INFOPLIST_FILE'].should == 'Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
native_test_target.symbol_type.should == :unit_test_bundle
@coconut_pod_target2.test_native_targets.count.should == 1
......
......@@ -551,6 +551,10 @@ module Pod
@test_pod_target.prefix_header_path_for_test_type(:unit).to_s.should.include 'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-prefix.pch'
end
it 'returns correct path for info plist for unit test type' do
@test_pod_target.info_plist_path_for_test_type(:unit).to_s.should.include 'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
it 'returns the correct resource path for test resource bundles' do
fa = Sandbox::FileAccessor.new(nil, @test_pod_target)
fa.stubs(:resource_bundles).returns('TestResourceBundle' => [Pathname.new('Model.xcdatamodeld')])
......
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