I was building a new project to do some experiments with wchar_t this morning. (Look here for the reason.) It seemed to me it took way longer than it should simply to get a CppUnit project setup in Xcode with a single test case. (It was primarily due to C++ and pilot error; I gotta say I’m gonna get a cold constantly moving between Ruby and C++.)
Consequently, I have built a skeleton CppUnit Xcode project. This provides you with a single class with a test method which asserts FALSE, demonstrating that the test process is working properly. It’s up to you to do something interesting with this head start.
Prerequisite for all platforms: install CppUnit.
If you’re on Mac OS X, with any luck you can simply build-and-go and you’ll see the results of the test (failure) in the debugger console.
If you’re on Linux, just disregard everything Xcode-related; you can still build and run the code from the command line (see the README file).
If you’re on Windows, gosh I’m sorry. 🙂 Nevertheless, you should be able to load these files into Visual Studio, set your header search directory to wherever CppUnit is installed, add the CppUnit library to your project, build and run.
Please let me know if you have any problems with this so I can keep it updated and hopefully save others a little time during CppUnit ramp up. Now GO WRITE A TEST!