Reputation: 874
I have an application that uses the Vuforia SDK (https://www.vuforia.com/) and a feature that does not work in the simulator. I started writing unit tests for this application and I'm not sure why but when I run the tests, it also tries to build the main application and fails because there is no valid architecture for i386.
Is is possible NOT to build the main application? I'm only testing a couple of model classes and a XML parser, no need to build the whole application...
Thanks !
Upvotes: 1
Views: 1126
Reputation: 4533
The unit test target that is created for new projects is an Application Unit Test. It injects your test code into the app by setting BUNDLE_LOADER and TEST_HOST in the build settings. You can create a new unit test target and by default this will be a Logic Unit Test (BUNDLE_LOADER and TEST_HOST are not set). Then add the code you want to test to the new target as well as your app target. Change your scheme to the new target and run your unit tests.
New Target Dialog
Target Membership
Select Scheme
Upvotes: 1
Reputation: 32651
You could put the classes that need testing into a library or framework and make the tests depend on the library. These tests and library will not require the Vuforia SDK.
The executable is a separate target (or even project) depending on the library but is built after the tests.
Upvotes: 4