How do I automatically perform unit tests on each "build and run" action in XCode 5?

Viewed 2417

I understand that a similar question was asked before, however the provided answer does not cover XCode 5. I understand that the TEST_AFTER_BUILD setting is obsolete in XCode 5 (see unit testing - RunUnitTests error after XCode 5 update) This naturally leads to my question: how exactly do I automate unit testing after each build, now that the setting is obsolete.

Very specifically:

  • I have several (more than 10) projects in my workspace.
  • When I press the RUN button in Xcode 5 (top left in UI), I want unit tests to run for ALL dependencies in the current scheme (assuming of course that related projects have been modified).
  • Additionally, if ANY of the tests would fail, the build and run action should fail.

This was working in XCode 4; see link above to understand how the 'old way to do it' is now broken.

This is a MIGRATION issue. I do not need a general (and possibly out of date) tutorial on unit testing in XCode.

3 Answers
Related