Florian Winter
We are trying to write units tests using the Boost.test framework which involve dynamic loading of libraries (i.e. lt_dlopen on Linux or LoadLibrary on Windows) and doing tests using the Boost test tools in code inside the dynamically loaded library.
Does Boost.Test support this?
Yes. You can do this. you can also use console_test_runner and execute test modules built as dlls.
We have run into problems when trying to use the quick-and-dirty "include" option for defining the Boost.Test symbols. Dynamically loaded libraries may not contain undefined symbols, and including the implementation headers such as
in both the dynamically loaded library and the main application seems to lead to duplicate symbols. In particular, if we use BOOST_CHECK macros
Yes. you can't do this.
We would like to know what is the "best" practice to use Boost.Test in unit tests that require dynamic loading of libraries and tests being made in both application code and dynamic library code.
Use dynamic library version of Unit test Framework. It will work perfectly fine in this scenario. Gennadiy