Commit d7790889 authored by Fabio Pelosin's avatar Fabio Pelosin

[Generator::Xcconfig] Add support for XCTest

Closes #1366
parent 31d5b990
...@@ -17,7 +17,7 @@ GIT ...@@ -17,7 +17,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 092a12526563550eb70c5c479bc2cea37b43a030 revision: d7bacd932526540b6d447dcb4358cec2822a68f9
branch: master branch: master
specs: specs:
xcodeproj (0.10.1) xcodeproj (0.10.1)
......
...@@ -106,7 +106,8 @@ module Pod ...@@ -106,7 +106,8 @@ module Pod
# @return [void] # @return [void]
# #
def self.add_developers_frameworks_if_needed(xcconfig) def self.add_developers_frameworks_if_needed(xcconfig)
if xcconfig.frameworks.include?('SenTestingKit') matched_frameworks = xcconfig.frameworks & ['XCTest', 'SenTestingKit']
unless matched_frameworks.empty?
search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= '' search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= ''
DEVELOPER_FRAMEWORKS_SEARCH_PATHS.each do |search_path| DEVELOPER_FRAMEWORKS_SEARCH_PATHS.each do |search_path|
unless search_paths.include?(search_path) unless search_paths.include?(search_path)
......
...@@ -156,6 +156,15 @@ module Pod ...@@ -156,6 +156,15 @@ module Pod
frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"') frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"') frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
end end
it "adds the developer frameworks search paths to the xcconfig if XCTest has been detected" do
xcconfig = Xcodeproj::Config.new({'OTHER_LDFLAGS' => '-framework XCTest'})
@sut.add_developers_frameworks_if_needed(xcconfig)
frameworks_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
frameworks_search_paths.should.include?('$(inherited)')
frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
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