views:

84

answers:

1
+2  A: 

Just a fast comment. The problem with this library is that it has at least three different ways of implementing and running the tests. Depending on what #defines you add to your code before including the boost unit test header, it can automatically generate a main function for you (and then build a complete program that executes the tests you've defined), or rely on external test runners.

Read carefully those running modes to know what to do. Usually, the easiest way is to do this:

  • Include your tests in a .cpp file.
  • Before including the unit test header file, define the preprocessor macro BOOST_TEST_MAIN (this will define a main function that will run the tests)
  • Link your program against the libboost-unit-test DLL (this is system dependant).

Your program will execute the tests defined, thank to the automatically generated main function.

Diego Sevilla