Automatic C/C++ mock generation for XCTest - CMock/OCMock?

1.2k views Asked by At

I want to develop using C & C++ using XCode 5. I particularly like the integration of XCTest and Xcode and the CI capability that you get by using OSX Server. I want to have a mocking framework, and ideally one where the mocks are automatically generated, as this seems most likely to ensure that the mocks follow a standard format (and themselves are not going to have errors).

Q1. I can't see how OCMock can work for mocking C & C++: is this possible?

Q2. CMock seems to be great, but it relies on Unity. Is it possible to integrate CMock into XCTest?

Q3. Does anyone have any other suggestions please?

1

There are 1 answers

2
Erik Doernenburg On BEST ANSWER

Q1. OCMock can only mock methods on Objective-C classes, objects, and protocols.

Q2. What is Unity? (And I'm asking this as the maintainer of OCMock...)

Q3. There are several options for C and C++, I don't have much experience, never mind a strong recommendation.