2

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?

Ying Zhou
  • 189
  • 3
  • 16
  • I'm currently working on a VS solution with something like 150 projects. More than 140 of them are single-cpp test projects. Keep your tests in separate suites? Absolutely! Different CPP files for different classes? Heck yeah. Different /projects/? I recommend not going this route for non-trivial systems. – Mark Storer May 09 '19 at 17:06

1 Answers1

1

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

Benjam
  • 1,401
  • 2
  • 16
  • 22