|
Boost Users : |
Subject: [Boost-users] boost test framework logging xml to file
From: Jaros³aw Bober (jaroslaw.bober_at_[hidden])
Date: 2011-12-20 09:50:37
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net