Reputation: 9576
I'm writing a reusable framework around XCTest for UI testing of several of our projects. For this I created a Cocoa Touch Framework project that I want to share via pods.
Is it possible to include XCTest into such a project (without extra test targets)? I'm getting errors that the XCTest module cannot be found even though I've linked XCTest.framework
in the build phases.
Upvotes: 2
Views: 1454
Reputation: 856
You should add $(PLATFORM_DIR)/Developer/Library/Frameworks
into Framework Search Paths
which in the Build Settings of your framework target. Basically, you don't have to link your framework against XCTest.framework
.
Also, if you're going to share the framework via pods you can add following code to your podspec file:
Pod::Spec.new do |s|
...
s.weak_framework = "XCTest"
s.pod_target_xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"',
}
...
end
Upvotes: 9