[boost::test] running unit tests from DLL with automatic registration facility
Hello Gennadiy,
using boost 1.35 & console runner and MSVC 2005 we did the following test:
FunctionalityDLL
^
|
UnitTestDLL
^
|
ConsoleTestRunner.EXE (as distributed in the example directory)
UnitTest.DLL
had the following defines:
#ifndef BOOST_TEST_DYN_LINK
# define BOOST_TEST_DYN_LINK
#endif
#ifndef BOOST_TEST_MODULE
# define BOOST_TEST_MODULE example
#endif
#include
Ovanes Markarian
Only after these modifications we were able to compile and run unit tests. Is there any chance to either update the docs with this example so that it becomes a sort of guarantee how it might work, or let the combination of BOOST_TEST_MODULE and BOOST_TEST_DYN_LINK generate the right linkage specification and export the symbol, otherwise this symbol was not found with GetProcAddress.With Kind Regards,Ovanes
The right way to construct your test module for now is to follow an example located in boost-trunk\libs\test\tools\console_test_runner\test\test_runner_test.cpp I do agree that it should probably work with regular definition as well. Unix implementation would be nice either ;) I was hoping we'd have Boost.Process/Boost.Extension by now. If I have a time I'll fix it before the release. As for the docs they are pretty much absent for this usage variant. And it doesn't look like I'll have time and endurance to pull it through for this component. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Ovanes Markarian