Boost logo

Boost Users :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-01-28 10:55:26


Hernán Leoni <leoni.hernan <at> gmail.com> writes:

>
> Hi,  I'm beginning to use Boost.Test, I decided  to create a test suite
(with BOOST_AUTO_TEST_SUITE) for each module to test, and various test cases
(with BOOST_AUTO_TEST_CASE) in each suite.  I was wondering is it exist any
macro to define functions to be executed at:

Are you referring to the 1.34.1?

> - test suit initialization: execute a function before any test in the test
suite
> - test suit finalization: execute a function after any test in the test
suite         

Not at this point. You can add test cases at the beggining and at the end of
the test suite to mimic this.

> - test setup: execute a function before each test
> - test tear down: execute a function after each test

use BOOST_FIXTURE_TEST_CASE( test_case_name, F ) to add fixture for individual
test case and BOOST_FIXTURE_TEST_SUITE( test_suite_name, F ) to add the same
fixture to all test cases within the test suite. You can read in details about
these facilties in

http://www.patmedia.net/~rogeeff/html/utf/user-guide/test-organization.html

HTH,

Gennadiy


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