c++ - Get BOOST TEST test suite name inside a test case -
i'm using boost test
, wonder if there way find out test suite
inside test case
. know can find test case
's name by:
boost::unit_test::framework::current_test_case().p_name
is there way find out suite name also?
my suites-cases structure is:
suite ---> case 1
______|--> case 2
______|--> case 3
thanks
a unit_test
has not p_name
p_parent_id
, id of test suite. both properties inherited test_unit
, common base class unit_test
, test_suite
.
to suite id, can @ how current_test_case
works:
test_case const& current_test_case() { return get<test_case>( s_frk_impl().m_curr_test_case ); }
the m_curr_test_case
member test_unit_id
, p_parent_id
. so, test suite of current test case, can use this:
framework::get<test_suite>(current_test_case().p_parent_id)
finally, test_suite
has p_name
property unit_test
, should find name there.
Comments
Post a Comment