Boost logo

Boost Users :

Subject: Re: [Boost-users] boost-test with wxWidgets
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-01-05 23:41:29


Matěj Týč <matej.tyc <at> gmail.com> writes:

>
> Hello all,
> is there anyone, who knows the Boost Unit Testing Framework (UTF)?

Well, I know a bit. What version r u planning to use? Did you read latest docs?

> I am
> developing a project that uses wxWidgets library and I would like to
> test some aspects where wxWidgets stuff is involved.
> The problem is that wxWidgets like to implement the main() function via
> IMPLEMENT_APP macro and I have found quite troublesome to work around
> that. When one lets UTF to generate the main() function, everything is
> very easy.
> The question is: There must be some sane way how to initialize UTF and
> launch a testsuite when wxWidgets are ready.

Yes. There is such a way.

> I also know that I should
> supply the framework with argc and argv since the verbosity of the test
> module output can be tweaked.
> I have learned so far that I have to implement function
> init_unit_test_suite( int argc, char* argv[]

Not necessarily.

> (but I don't have an idea how),
> and that I have to register test cases (that should be OK) and to
> create some master test suite. Am I missing something here as well?

You would usually register test units manually inside the init_unit_test_suite.

> I haven't found anything in the documentation that would lead me to the
> result, could you help me and possibly extend the documentation a little
> bit so wxWidgets users could start using UTF massively?

Simplest approach is to use dynamic library variant of the UTF
(http://www.boost.org/doc/libs/1_37_0/libs/test/doc/html/utf/user-guide/usage-variants/dynamic-lib-variant.html)
and follow example 9 on this page:
http://www.boost.org/doc/libs/1_37_0/libs/test/doc/html/utf/user-guide/test-organization/manual-nullary-test-case.html

There is an ability to use automated registration for test units as well if you
opt to.

HTH,

Gennadiy

> Regards,
> Matej
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net