Hello,
is there a way to get test case name from global fixture?
What I would like to have is separate xml file report for every test case.
I'd like to do it this way:
#include <string>
#include <fstream>
struct LogToFile
{
LogToFile()
{
std::string logFileName(boost::unit_test::
framework::master_test_suite().p_name);
logFileName = current_test_case_name ;
logFile.open(logFileName.c_str(), std::ios_base::app);
boost::unit_test::unit_test_log.set_stream(logFile);
}
~LogToFile()
{
logFile << "</TestLog>" << std::flush;
logFile.close();
boost::unit_test::unit_test_log.set_stream(std::cout);
}
std::ofstream logFile;
};
BOOST_GLOBAL_FIXTURE(LogToFile);
Can I do that?
Regards