Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-02-25 12:06:25


Gennadiy Rozental wrote:

> As for callback based interface (another thing is that I couldn't
> depend on boost::function) your proposition would complicate users
> interface: one need not only define the init function itself but she
> also has to write main function itself that invoke the framework and
> pass this callback (or another function I would call from main myself
> but this would be catch-22)

Maybe a macro version of init_unit_test_suite would be acceptable. Invocation
could look like:

 INIT_UNIT_TEST_SUITE(int, char* [])
 {
    test_suite* test = BOOST_TEST_SUITE("test name");
    // add tests
    return test;
 }

This could expand to

 ::boost::unit_test_::test_suite* init_unit_test_suite(int, char* []);

 int main(int, char* [])
 {
      // register callback, run framework, return result
 }

 ::boost::unit_test_::test_suite* init_unit_test_suite(int, char* [])
 {
    test_suite* test = BOOST_TEST_SUITE("direct_adapter test");
    // add tests
    return test;
 }

Jonathan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk