Reputation: 1106
I am wondering if you can link one Unit Testing bundle to multiple targets. So one can test all the application targets with one Testing bundle.
I have some shared code between all app targets but also some specific calculations based upon which app target is running.
Currently I have to set the Bundle Loader option in the Build Settings to the used application target's .app file if I want to test a different application target.
My question to you all is : can this be done without creating multiple test bundle targets for every app target, and without always changing the Bundle Loader option?
Upvotes: 41
Views: 6643
Reputation: 351
You can create several test targets - one for each app target, and then simply put all of your actual test source files into a separated group folder, making sure you select all the test targets for each of the files. Described here: https://medium.com/@rijalab/how-to-use-one-test-target-files-for-two-app-targets-in-ios-37df53265a5
Upvotes: 0
Reputation: 146
You need to:
Test navigation
tabEnable [name_of_your_target]
Upvotes: 8
Reputation: 6112
No, at this point you can't. It's like the extensions, you have to create a new one for each project's targets you have.
It's not pretty usefull but if the code differes from one to another target, the tests can fail because of missing code, not failing code.
It's why it's not allowed.
Sorry for the negative answer.
Upvotes: 3