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: - 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 - test setup: execute a function before each test - test tear down: execute a function after each test Is there an easy way to do what I need? Many thanks, Hernan
Hernán Leoni
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
participants (2)
-
Gennadiy Rozental
-
Hernán Leoni