1 // (C) Copyright Gennadiy Rozental 2003-2008.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
13 // ***************************************************************************
15 #ifndef BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER
16 #define BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER
19 #include <boost/test/detail/global_typedef.hpp>
20 #include <boost/test/detail/log_level.hpp>
21 #include <boost/test/detail/fwd_decl.hpp>
25 #include <string> // for std::string
27 #include <boost/test/detail/suppress_warnings.hpp>
29 //____________________________________________________________________________//
35 // ************************************************************************** //
36 // ************** log_entry_data ************** //
37 // ************************************************************************** //
39 struct BOOST_TEST_DECL log_entry_data
{
42 m_file_name
.reserve( 200 );
45 std::string m_file_name
;
46 std::size_t m_line_num
;
53 m_level
= log_nothing
;
57 // ************************************************************************** //
58 // ************** checkpoint_data ************** //
59 // ************************************************************************** //
61 struct BOOST_TEST_DECL log_checkpoint_data
63 const_string m_file_name
;
64 std::size_t m_line_num
;
65 std::string m_message
;
71 m_message
= std::string();
75 // ************************************************************************** //
76 // ************** unit_test_log_formatter ************** //
77 // ************************************************************************** //
79 class BOOST_TEST_DECL unit_test_log_formatter
{
81 enum log_entry_types
{ BOOST_UTL_ET_INFO
,
85 BOOST_UTL_ET_FATAL_ERROR
};
88 virtual ~unit_test_log_formatter() {}
90 // Formatter interface
91 virtual void log_start( std::ostream
&, counter_t test_cases_amount
) = 0;
92 virtual void log_finish( std::ostream
& ) = 0;
93 virtual void log_build_info( std::ostream
& ) = 0;
95 virtual void test_unit_start( std::ostream
&, test_unit
const& tu
) = 0;
96 virtual void test_unit_finish( std::ostream
&, test_unit
const& tu
, unsigned long elapsed
) = 0;
97 virtual void test_unit_skipped( std::ostream
&, test_unit
const& ) = 0;
99 virtual void log_exception( std::ostream
&, log_checkpoint_data
const&, const_string explanation
) = 0;
101 virtual void log_entry_start( std::ostream
&, log_entry_data
const&, log_entry_types let
) = 0;
102 virtual void log_entry_value( std::ostream
&, const_string value
) = 0;
103 virtual void log_entry_value( std::ostream
&, lazy_ostream
const& value
); // there is a default impl
104 virtual void log_entry_finish( std::ostream
& ) = 0;
107 } // namespace unit_test
111 //____________________________________________________________________________//
113 #include <boost/test/detail/enable_warnings.hpp>
115 #endif // BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER