Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2003-04-21 11:01:55


"Vladimir Prus" <ghost_at_[hidden]> wrote in message
news:200304211902.37701.ghost_at_cs.msu.su...
>
> I have quite a bunch of tests which use test execution monitor and look
like
> this
>
> int test_main(int ac, char* av[])
> {
> test_a();
> test_b();
> }
>
> and so on. There's another method, in which there's "init_unit_test_suite"
> method, which returns a property initialized test_suite object.
>
> What are the advandates of the second method, assuming all my tests will
be
> free-standing functions? Is there something that I loose by not switching
to
> that method? I'm really trying to understand if I should invest any time
into
> this.

>From top of my head.

1. You will get separate statistic for every test case (number of
passed/failed assertions
2. Above If test_a throw an exception, test_b will never be executed. With
test cases, each one have separate execution monitor. So test_b will run
even if previous test case failed with exception.
3. Next release you will be able to run specific test cases by name
4. test cases would IMO much more clear reflect you intention.

There is something else, I think.

Gennadiy.


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