Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Building a test module with the UTF

Test module initialization
Custom module initialisation
Automated generation
Linking with the UTF
Static library variant
Dynamic library variant
The single-header variant of the UTF
The external test runner variant of the UTF
Macros that control the build behaviours
BOOST_TEST_MAIN
BOOST_TEST_ALTERNATIVE_INIT_API
BOOST_TEST_NO_LIB
BOOST_TEST_DYN_LINK
BOOST_TEST_NO_MAIN
BOOST_TEST_MODULE

There are two tasks should be performed before actual testing is able to start:

The part of the UTF dedicated for this purpose is called the test module initialization function.

[Note] Note

Note that alternatively to module initialization, global fixtures may be employed.

The module initialization and the way the test module is linked against the UTF are closely related. The method used to link against the UTF are often lead by considerations external to the tests themselves (compilation time, size of the generated binaries, etc). However, the functions of the module initialization involved in, say static and dynamic linking, will not be the same. To cover many possible usages, the UTF handles several different variants of linking, and indirectly the tools for proper module initialization corresponding to each of these variants are provided.


PrevUpHomeNext