How can I successfully do TDD on Xcode with C ++?

I am currently working on the release of OpenGL ES 1.0 using C ++ on iOS.

I just can't find a way to seamlessly integrate any unit testing infrastructure for TDD for this particular setup.

Workspace:

  • OS: OS / X 10.7
  • Target device: iOS
  • main language: C ++
  • IDE: Xcode
  • OpenGL ES 1.0

I tried googletest, but in order to make googletest work, I would have to create a command line application, but since I use OpenGL ES 1.0, I cannot import them into a command line application on a Mac.

I tried a new method called catch, but I don't know how I can integrate with Xcode.

Anyone have a good solution for this problem?

+3
source share
1

TDD. , , , , . , c api, , . , , . , .

, , . ++ ++ ( ). :

class ICommandLineOutput
{
public:
  virtual void WriteLine(std::string&) = 0;
};

, , , WriteTime. , , ICommandLineOutput . , , . , , ICommandLineOutput.

class WriteTime
{
public:
  explicit WriteTime(ICommandLineOutput commandLine): _commandLine(commandLine){}
  ...
};

, ++, , . Google Test, . , GUI, GUI ++, .

, , . TestWriteTime. GoogleMock ICommandLineOutput. / , , WriteTime, . , , WriteLine() .

, Linux- . . , Windows, . , TDD.

0

All Articles