Search code examples
c++boostboost-test

Shall I test different classes separately using Boost.Test?


I'm using Boost.Test with Xcode to test my C++ program. There are several ways to do so.

  1. Test each class separately. That is, I should start multiple projects, one project for each class. Boost should provide the main().

  2. I should use my own main() written using Boost.Program_Options. A test option should be added and when invoked all functions other than main() will be tested.

I'm new to Boost.Test. Which option is better?


Solution

  • as a C++ developer, I would advise you to maintain a separate unit test suite for each production source code file. Use "Test" as a prefix/suffix to name the test suite. So, to my opinion, option 1.

    Cheers