You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kovaron edited this page Feb 25, 2013
·
4 revisions
First of all download the UnitTest++ framework from this git repo or even from it's own website (http://unittest-cpp.sourceforge.net/). Place it in some folder and note the folder's name and full path (mainly on linux). On linux open up a terminal and navigate into the folder containing the framework. Run a make command which generates a ".a" file.
Now open Code::Blocks, and then create a new project according to your needs (in our case it's mostly Console application). On windows open the UnitTest++ project itself, and build it (it generates the same ".a" file as we did on linux).
In your project click Project -> Build options. In the upcoming window select the main project in the list on the left side, not Release or Debug. Then select Linker settings, where we will add the formerly generated ".a" file. After change to the Source page and add the src folder of your UnitTest++ folder. (On linux systems I would suggest to use absolute path instead of the default relative).
When it's all done, open you main.cpp
And as the last step, make sure that your main.cpp consists of these lines: #include <iostream> #include "../UnitTest++/src/UnitTest++.h"
using namespace std;
int main(){ return UnitTest::RunAllTests(); }
I changed this wiki page to english, just to get used to english as a default working language.