Reputation: 149
I working on Xcode 6. When I coding XCTest, Xcode has been crash. When I reopen my Xcode, and it lost little diamond run button.
It should be:
But it got:
I open other project and it don't have this error. But when I create new target, it get same error (in other project).
I checked Target Membership, but it checked in target name. When I choose Test in Product>Test it run but the button not show.
Thank a lot, sorry for my bad english.
Upvotes: 9
Views: 6895
Reputation: 241
Prefix func name with test
example test function name:
secondExample() must be **testSecondExample()**
then clean the build file use this shortcut key command + shift + k
Upvotes: 0
Reputation: 2487
I just re-started my Xcode and it worked. as everything was set-up the way it should be !!
Upvotes: 1
Reputation: 591
In case you disabled indexing earlier,
Close all Xcode and Simulator instances
Delete this setting
defaults delete com.apple.dt.Xcode IDEIndexDisable
Restart Xcode
This should reenable indexing and should bring back the individual test button (diamond shaped) in the subsequent Xcode launch.
Upvotes: 3
Reputation: 5297
Solution that is working for me in Xcode 13, SWIFT 5:
Open another Xcode file and then open the file wth your function again, the button should appear then.
Upvotes: -1
Reputation: 1299
Go to,
Xcode > Window > Projects
click on the delete button for derived data. Close Xcode and open again. You should be good to go.
Upvotes: -1
Reputation: 712
A possible answer for some - I had added a new scheme in Xcode, but the tests were only in the original scheme. Switching back to the original scheme re-instated my tests.
Upvotes: 1
Reputation: 409
Target Membership
.Upvotes: 5
Reputation: 3489
In Xcode 12.4 just Command+U
or menu Product > Test
and all buttons in your XCTestCase
will appear again.
Upvotes: 1
Reputation: 915
My issue was file was not included in the workspace. If not included, go to finder and drag and drop to that folder.
Upvotes: 1
Reputation: 1281
There is two way to check it.
Upvotes: 3
Reputation: 109
Need More description? But Try following troubleshooting... check Target Membership of test file
Upvotes: -1