I use boost::test
to run integration tests on a class that creates directories and files. I would like
these files to be named test-case specific so if I run into trouble I can easily find which test case left its directories/files around.
So I would like to use the test case name in the constructor of the fixture that I'm using, as demonstrated below. Is this possible at all, and how? I searched the boost::test manual but could not find this information.
e.g.
struct foo_fixture
{
foo_fixture()
{
std::string case_dependent_name( BOOST_TEST_CASE_NAME );
create_directory( case_dependent_name );
}
};
BOOST_FIXTURE_TEST_CASE ( foo_case_one, foo_fixture )
{
...
}
BOOST_FIXTURE_TEST_CASE ( foo_case_two, foo_fixture )
{
...
}