Lets say I have a pod DevelopmentPod.
In the podspec for this pod, i have added a test_spec as follows -
s.test_spec 'UnitTests' do |test_spec|
test_spec.source_files = 'UnitTests/**/*.{h,m,swift}'
test_spec.ios.resources = ['UnitTests/**/*.{json}']
end
In the Podfile of my project, I have added the pod as follows -
pod 'DevelopmentPod', :path => '<location>', :testspecs => ['UnitTests']
After running pod install, I see that a new target DevelopmentPods-Unit-Tests has been created and using the new scheme in Manage Schemes, I can execute the test cases comfortably.
To integrate this scheme in Jenkins, I will need separate job for this. And I have multiple development pods, which means multiple jobs. Also then will have to consolidate the test case execution data from different jobs. And we can not deterministically say that the code tested by these individual jobs is same as that of the actual build.
What is the best way to solve this problem?
I can easily move all unit tests from different pods to my main app and create a unit test target for the same (which solves the Jenkins job issue too) but then my main app will get cluttered with a lot of unit test code it does not require at all. I would like to keep a pod specific unit test in the pod itself.
xcodebuild
command line tool? You should be able to create fairly simple script that runs all your test schemes. - Losiowaty