Hi,
I'm planning to change from CppUnit to Boost.Test for unit testing since
it is now possible to integrate unit tests also in a DLL. Nevertheless I
do encounter some problems here.
The code is (I guess you'll recognize it):
//----------------------------------------------------------------------
---
#define BOOST_TEST_DYN_LINK
#include
using namespace boost::unit_test;
BOOST_AUTO_TEST_CASE( test1 )
// void test1()
{
int i = 0;
BOOST_CHECK_EQUAL( i, 2 );
}
BOOST_AUTO_TEST_CASE( test2 )
{
BOOST_CHECKPOINT("About to force division by zero!");
int i = 1, j = 0;
i = i / j;
}
extern "C" {
__declspec(dllexport) bool
init_unit_test()
{
printf("Initializing\n");
framework::master_test_suite().p_name.value = "Test runner test";
// framework::master_test_suite().add( BOOST_TEST_CASE( &test1 ) );
return true;
}
}
//----------------------------------------------------------------------
---
I the sample (test_runner_test.dll) it works fine but when I use it in
my DLL I get:
C:\Projekte\Test\NetControl\bin>console_test_runner --test NetCtrld.dll
Initializing
Test setup error: test tree is empty
I also tried the commented version using master_test_suite().add()
without any change.
Any hint what I can try or how I can debug this?
Thanks,
Christian