07-20-2023, 05:27 AM
I would like to use OCMock in my Cocoa project's unit tests. I have downloaded the latest version of OCMock (2.0.1) and copied the *OCMock.framework* into my project's directory. In Xcode, I have added the framework to the unit test target's *link* phase. I have then added some code that uses OCMock's classes.
From then on out, all unit tests are reported as "successful" - green light, no errors or warnings. Even after introducing `STFail` calls, Xcode claims "Test succeeded". Placing a breakpoint in arbitrary test methods reveals that none of them are executed.
The issue persists if I comment out the code using OCMock, including the `import` directives.
The issue vanishes - i.e., the `STFails` start failing again - when I remove OCMock from the link phase.
This is similar to [another question][1] I've asked before, but not exactly the same: In this case, the info in the Log Navigator shows no errors. What could be causing this behavior? What can I do to diagnose the matter?
[1]:
From then on out, all unit tests are reported as "successful" - green light, no errors or warnings. Even after introducing `STFail` calls, Xcode claims "Test succeeded". Placing a breakpoint in arbitrary test methods reveals that none of them are executed.
The issue persists if I comment out the code using OCMock, including the `import` directives.
The issue vanishes - i.e., the `STFails` start failing again - when I remove OCMock from the link phase.
This is similar to [another question][1] I've asked before, but not exactly the same: In this case, the info in the Log Navigator shows no errors. What could be causing this behavior? What can I do to diagnose the matter?
[1]:
[To see links please register here]