I have a problem that the Xcode IDE 6 doesn't detect my swift unit test cases correctly. When I run the unit tests, all tests were executed.
But in the IDE while editing the unit tests aren't recognized. I have to run the whole unit test suite in order to run a single test.
I couldn't figure out how I avoid this glitch.
To add a unit test target to an existing Xcode project, choose File > New > Target. Select your app platform (iOS, macOS, watchOS, tvOS) from the top of the New Target Assistant. Select the Unit Testing Bundle target from the list of targets.
Enabling Code Coverage in Xcode Code coverage is enabled in the scheme editor. Click the Covered scheme and choose Edit Scheme.... Select Test on the left and check the checkbox Gather coverage data. That is it.
Turn live unit testing from the Test menu by choosing Test > Live Unit Testing > Start.
The really short version is that unit tests have access to the code in your app (or whatever kind of module you are building) and UI tests do not have access to the code. A unit test only tests one single class per test.
Problem is solved. All I have to do is to launch the "Window -> Projects" window and delete the "Derived Data. After indexing all tests are working.
In the meanwhile apple is fixing the bugs in the Xcode 6.3 editor bit by bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With