[boost.test] Customized test suite gives SIGSEGV when setup fails

Hello, I'm getting a SIGSEGV when trying the following with Boost 1.35.0 and gcc 4.1.2: ---%<--- #define BOOST_TEST_ALTERNATIVE_INIT_API #include <boost/test/included/unit_test.hpp> using namespace boost::unit_test; struct my_test_suite : public test_suite { my_test_suite() : test_suite("my_test_suite") { throw std::runtime_error("runtime_error"); } }; bool init_unit_test() { test_suite *test = BOOST_TEST_SUITE(""); test->add(new my_test_suite()); framework::master_test_suite().add(test); return false; } ---%<--- When run in the gdb, I get the following output: ---%<--- (gdb) run Starting program: a.out Test setup error: std::runtime_error: runtime_error Program received signal SIGSEGV, Segmentation fault. 0x0806e2fa in ~framework_impl (this=0x8089740) at boost/test/impl/framework.ipp:126 126 delete (test_suite const*)tu.second; --->%--- The code in question has been ported from an old Boost.Test version to 1.35. When looking at the documentation for Boost.Test (1.36, as this seems more in sync with Boost.Test 1.35) I'm unsure that custom test suites are still supported in this way. What I need to do is to set up and tear down a database connection at the start/end of a test suite execution. Is there some other way for this? TIA, Markus

Markus Schöpflin <markus.schoepflin <at> comsoft.de> writes:
Markus Schöpflin wrote:
Hello,
I'm getting a SIGSEGV when trying the following with Boost 1.35.0 and gcc 4.1.2:
[...]
Just for info, the behaviour is the same for Boost 1.36.0.
Fix checked into trunk. Gennadiy

Gennaidy Rozental wrote:
Markus Schöpflin <markus.schoepflin <at> comsoft.de> writes:
Markus Schöpflin wrote:
Hello,
I'm getting a SIGSEGV when trying the following with Boost 1.35.0 and gcc 4.1.2: [...]
Just for info, the behaviour is the same for Boost 1.36.0.
Fix checked into trunk.
Thank you. I merged changeset 48766 to my 1.35.0 tree, and it fixed the problem there too. Markus
participants (2)
-
Gennaidy Rozental
-
Markus Schöpflin