Boost C++ Libraries Home Libraries People FAQ More


Compilation and Usage Variants

Minimal Header
Header Only
Static Library
Shared Library

Boost.Test is available in several forms:

The minimal header can be useful in situations where you don't already have the library built and want to quickly explore a test with a minimal amount of fuss. Once you need to create multiple unit tests, you will quickly outgrow the minimal header.

The header only form is useful when you don't want to be bothered with compiling the library. Once you have multiple compilation units with unit tests in each compilation unit, you will grow tired of the compilation cost involved with the header only form of the framework.

The static library form is the easiest to integrate into your build system as it doesn't require any installation of runtime files in order to execute your tests. This runtime simplicity comes at the cost of increased link times and executable sizes.

The dynamic library form requires the most effort for successful test execution, but provides faster link times than the static library, faster compile times than the header only form and provides all the features of the framework compared to the minimal header.

[Caution] Caution

Boost.Test is not a thread-safe library. Care should be taken when automated tests create multiple threads and interact with data structures passed to Boost.Test macros or functions.