2

Our iPhone app uses the built-in SenTestingKit for unit tests, and KIF for functional tests. We're using Zapp for CI, which runs the functional tests but not the unit tests. As a stopgap, I'd like to add a functional test scenario which runs the unit tests. Is there a way to run SenTestingKit unit tests programmatically? i.e. not via a script, but from within the application?

Simon
  • 25,468
  • 44
  • 152
  • 266

1 Answers1

0

Why don't you create a new scheme which runs all the tests for your project, and use a script to run all the unit tests ?

For example, if the name of your project is simon, the scheme for your test target will be simonTests

Run the script on command line

xcodebuild .../your_.proj_file_path/ -scheme "simonTests" -sdk iphonesimulator5.0 -configuration "Debug" clean build

This build would essentially run unit tests for you.

Simon
  • 25,468
  • 44
  • 152
  • 266
Legolas
  • 12,145
  • 12
  • 79
  • 132
  • I'm specifically trying to run the unit tests from Zapp as part of a KIF test step, so I need to do it programmatically (i.e. from within the app) rather than via a script. – Simon Apr 16 '12 at 06:44
  • @Simon You do have a KIF target right ? Can't you set the options for Unit Testing in the schematic ? – Legolas Apr 17 '12 at 14:46
  • I do, but I'm not trying to run unit tests from a script, I'm trying to run them from within a KIF test scenario. I want to call some function like STKRunUnitTests() and have them run. – Simon Apr 17 '12 at 16:13