Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-09-29 11:02:16


> | I had been using Boost test with 1.32 successfully
> |
> | #include <boost/test/test_tools.hpp>
> | #include <boost/test/floating_point_comparison.hpp> // Extra
> | test tool for
> | FP comparison.
> |
> | but with 1.33 it fails to compile at
> |
> | using boost::unit_test_framework::unit_test_log;
> | using boost::unit_test_framework::log_level;
> |
> | and used this to control the log threshold
> |
> |
> | unit_test_log::instance().set_log_threshold_level_by_name("tes
> | t_suite");
> |
> | and to switch the log file
> |
> | unit_test_log::instance().set_log_stream(flog); // Switch to log
> | file.// unit_test_log::instance().set_log_stream(cout);
> | // Switch back to
> | cout,
> |
> | But this has been removed in 1.33
> |
> | but I am unclear how to replicate this sort of function.
> |
> | Suggestions?
> |
> | Thanks
> |
> | Paul

1. Include <boost/test/unit_test_log.hpp>
2. use boost::unit_test::unit_test_log::set_threshold_level(
log_level_value ) to set log level, where log_level_value is the value of
enum log_level (see <boost/test/detail/log_level.hpp>).
3. use boost::unit_test::unit_test_log::set_stream( std::ostream& ) to reset
log stream

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk