문제

Has anyone tried using OCMock test framework with XCTest framework? We were using OCMock test framework with SenTest framework and ever since we migrate from SenTest to XCTest, OCMock tests stops compiling. I know, XCTest does not have in-built support for OCMock test framework and below are the steps I have tried with by far:

  1. Go to Edit --> Refactor --> Convert to XCTest.
  2. Add XCTest framework to the test target.
  3. Go to Editor --> Add Build Phase --> Add Copy Files Build Phase
  4. Add the OCMock framework to the Copy Files build phase.
  5. Set the copy destination to the Products Directory.

After doing all this XCode is not able to locate the OCMock test framework and is complaining the same while compilation.

Any suggestions.

도움이 되었습니까?

해결책

I just noticed this which could be the potential reason for this issue:

After reading through some documentation I get to know that OCMock versions 2.2 and later work with XCTest. I am using using 2.1 version which could be a reason for compilation errors.

Reference: XCode with XCTest and OCMock Versions

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top