Xcode 6 Editor doesn't recognize unit tests
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.
Solution 1:
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.
Solution 2:
For me the fix was to prefix all method with 'test'
i.e.
func arrayResponseCall()
should be:
func testArrayResponseCall()
Solution 3:
The "fix" for me was to add a new test. I made up some nonsense:
func testThatNothing() {
XCTAssertTrue(true, "True should be true")
}
When I ran the tests again, all the tests in that file were recognized by the editor. I deleted the bogus test and it's all still fine. Unfortunately I had to do this in each file, but at least it works. Hope this helps someone.
Solution 4:
Below are few solution for this issue :
Wait for sometime. It takes time to load diamond sometimes. Navigate between different files and then move to same test-case it should appear.
Clean project, Clean build folder and even delete derived data content. Check this how to delete derived data safely.
Quit Xcode and open it again.
Make sure that your test-case name begins with
testFunc_Name
Sometimes your test-case file may contain function other than test-case. In such scenario diamond symbol doesn't appears.
Remove such function.
In my case 1, 3 and 5 solution often worked for me.
Solution 5:
For me , I need to add Tests to below here