Test: Aborting at global fixture

Hello, what is the canonical way of reporting an error that accours at the global fixture: #include <boost/test/unit_test.hpp> struct GlobalFixture { GlobalFixture() { std::cout << master.argc << std::endl; BOOST_FAIL("CRASH BOOM"); } ~GlobalFixture() { std::cout << "Global teardown\n"; } }; BOOST_GLOBAL_FIXTURE(GlobalFixture) Crashes with segfault. Thanks, Florian

Florian Lindner <mailinglists <at> xgm.de> writes:
struct GlobalFixture { GlobalFixture() { std::cout << master.argc << std::endl; BOOST_FAIL("CRASH BOOM"); }
Crashes with segfault.
This report proper message in Boost.Test v3: Test setup error: std::runtime_error: can't use testing tools outside of test case implementation Use exceptions instead inside the global fixture. Gennadiy
participants (2)
-
Florian Lindner
-
Gennadiy Rozental