2. You may not need main. You can do your initialization either in global fixture or in test suite initialization function (like in example above)
Thanks for the great tip- I have organized the program to work this way. The sample code doesn't quite work, I had to cast the initialization function that is passed into unit_test_main (boost::unit_test::init_unit_test_func).
Cast to what? init function has right signature.
I did that and I got pretty far but there is a strange runtime error that happens here:
test_unit& get( test_unit_id id, test_unit_type t ) { test_unit* res = s_frk_impl().m_test_units[id];
if( (res->p_type & t) == 0 ) throw internal_error( "Invalid test unit type" );
return *res; }
What the error message?
The test case I added was simpler and had no parameters to pass:
framework::master_test_suite().add( BOOST_TEST_CASE(TestMain) );
Please post simple example. I do not follow what is your problem. By the way what version of Boost r u using?
That happens successfully but the main test program never gets called and execution stops at the location above.
I saw this link: http://lists.boost.org/Archives/boost/2006/03/102592.php
This issue fixed since. And it was just an issue with proper error report.
Looks like I do need to autoregister a test suite first? I tried registering one with no luck.
No you don't. Gennadiy