Running Tests on the Command Line
One thing that may have occurred to you is that all the tests run up to this point have been performed in the Xcode GUI, either by clicking gutter buttons in the editor view, run buttons in the Test navigator, or with the menu item Product > Test (⌘U). That’s all well and good, but it’s obviously inadequate if you want your tests to be part of a continuous integration (CI) process, one which automatically runs tests for you, either periodically (like every night), or maybe every time new code is checked in.
Fortunately, it’s simple to have Xcode run tests from the command line or in a shell script. It’s actually a lot like automated building of your project, which you saw way back in Building on the Command ...
Get Xcode Treasures now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.