Unit test framework and environment initialization/finalization
Hello all, My name is Aleksandr Vinokurov, I've just read the site docs on Boost.Tests and now I start writing tests. And realized that there were nothing told about initialization and finalization of the environment of the test suite. I mean some kind of solid calling my finalization function to properly stop the environment, like a try {} final {} in Java -- even if the test fails by BOOST_REQUIRE or BOOST_FAIL. Any suggestions or recommendations from gurus? Oh, just remembered: I use 1.33 version of Boost. With best wishes, Aleksandr Vinokurov Senior Software engineer CJSC "PETER-SERVICE" ========================== Work tel:+7(812)326-12-99 ext. 5039 Fax tel:+7(812)326-12-98 E-mail: mailto:aleksandr.vinokurov@billing.ru URL: http://www.billing.ru
I mean some kind of solid calling my finalization function to properly stop
Vinokurov, Aleksandr
final {} in Java -- even if the test fails by BOOST_REQUIRE or BOOST_FAIL.
Any suggestions or recommendations from gurus?
You should use Fixtures.
Oh, just remembered: I use 1.33 version of Boost.
This release did not have internal support for fixtures, but you can do regular C++ RAII based solution. Implement fixture class (init in contructor, teardown in destructor) and instantiate it on a first line of test method. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Vinokurov, Aleksandr