Reputation: 2590
I have added a new unit test to my project's test target recently, and when I hit Product > Test, Xcode says, "Test succeeded". I am fairly certain though that the test should fail, because the method under test has not been implemented yet. I added a breakpoint to the test, but it is never being reached; the test is still "successful" without breaking. Growing suspicious, I have added STFail
to a different test - still, "Test succeeded".
I am certain that the unit tests did work in the past. Since then I haven't performed any changes to the project structure I am aware of; only that I have updated Xcode to 4.4.
I have found this post explaining how to examine the scheme's test settings, and they look correct to me: the test target is listed under "tests", and it and all of its tests are checked.
What can I do to find the reason for the tests always succeeding?
Upvotes: 0
Views: 528
Reputation: 2590
The issue was caused by a framework I had added to the project that caused an error on execution.
I decided to ignore the unit tests for now and move on to the actual project. When I ran it, it produced an error:
dyld: library not loaded: <Framework name>
Once I saw this, I removed the newly referenced framework, and the unit tests behaved as expected. I then discovered the little buttons to the far right in the test results page that pop open the test's console output. There were the error messages Xcode had hidden all the time, claiming the tests ran successfully.
Upvotes: 1