Unit Test

Unit Test
0.0 0


I want to write unit test code for cocos2d.
What framework should i use?
I tried googling a lot, but no useful result


i use GTest they work great also it is easy to port on Android and iOS


Hi gelldur, I am trying to do this too. I have successfully created a project with C++ and have run unit tests with Xcode. The problem that I have now is that I have a Cocos2d-x project but I want to write some Gtests for it, without having to start the simulator. Is that possible?


I was running my unit tests on linux only without simulator. Ofcourse if you want run them on real device no problem.

Simply change you code for example in main.cpp :smile:


I am using the Xcode project that cocos comes with but it’s not compiling. Steps are use the Xcode project which comes with gtest. I add the Xcode cocos project but it fails. Do you mind outlining step by step instructions because I am new to Xcode and c++. I appreciate any help