views:

125

answers:

1

I have an interesting situation where I am refactoring a bunch of ObjC iPhone code to create a C++ API. I'm a novice to C++ and looking into C++ mocking frameworks to augment the work I'd done using OCUnit and poor man's mocks. I ran across googlemock and wanted to know if anyone has ever used it for iPhone development? Also, how can I share this (or mockpp) with other devs as it is an installable package and doesn't seem to lend itself to checking into a repository?

A: 

I've never used Googlemock for iPhone development, but have used it plenty on Windows and various UNIXes.

It uses standard modern C++ with TC1 (Technical Corrigenda 1) so can compile on any up to date, compliant compiler.

If your development environment doesn't implement TC1, then Google also include a subset of the Boost library that implements Tuples, which is the part of TC1 that Googlemock depends on.

Basically, if your compiler can handle templates, it should be able to handle Googlemock.

You can download the full source from Googlecode and this is what you might want to check into your repository.

Seb Rose
Thanks. I'm looking for a sharable binary. I just don't understand why these things need to be built from source and installed globally/statically on your system. I'm used to Java where you can just download the jar and put it in your path, or use multiple versions across multiple projects.
Cliff
Java runs on a virtual machine (which is theoretically the same on every platform), while most C++ compilers target the machine's CPU, which is why these libraries need to be built separately for each platform. The Googlemock library has been written in a platform independent fashion, which is much more than just using standards-compliant C++. There are a host of incompatibilities between the various operating systems and execution environments.So, you'll need to build the library yourself for your own platform... or find someone who already has.
Seb Rose