4.7.2.3 Configure the Testing Target

Now that you have a target for your tests, add the tests to that target.

  1. With the project settings still selected in the Project Navigator, and the new integration tests target selected in the project settings, select the "Build Phases" tab.
  2. Under the "Link Binary With Libraries" section, press the "+" button.
  3. In the sheet that appears, select CFNetwork.framework and SenTestingKit.framework and click "Add".
  4. Then click "Add other..." in the lower left corner and locate and select the library librc.mobile.ios.nativ.a and click "Open".
  5. Next, make sure that the UIRemoteControl.h header file can be accessed. To do this, add the UIRemoteControl.h to the "Header Search Paths" build setting. Start by selecting the "Build Settings" tab of the project settings, and from there, use the filter control to find the "Header Search Paths" setting.
  6. Double click the value, and add the file UIRemoteControl.h to the list. If it's not there already, you should add the $(inherited) entry as the first entry in this list.
  7. The iOS support takes advantage of Objective C's ability to add categories to an object, but this isn't enabled for static libraries by default. To enable this, add the -ObjC and -all_load flags to the "Other Linker Flags" build settings.
  8. Finally, add a preprocessor flag to the testing target so that you can conditionally include code. This will help to make sure that none of the testing code makes it into the production app. Call the flag "RUN_FUNCTIONAL_TESTS" and add it under the "Preprocessor Macros". Again, make sure the $(inherited) entry is first in the list.



Copyright BREDEX GmbH 2014. Made available under the Eclipse Public License v1.0.