| 1 | // (C) Copyright Gennadiy Rozental 2001. |
| 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) |
| 5 | |
| 6 | // See http://www.boost.org/libs/test for the library home page. |
| 7 | // |
| 8 | /// @file |
| 9 | /// @brief Contains the formatter for the Human Readable Format (HRF) |
| 10 | // *************************************************************************** |
| 11 | |
| 12 | #ifndef BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER |
| 13 | #define BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER |
| 14 | |
| 15 | // Boost.Test |
| 16 | #include <boost/test/detail/global_typedef.hpp> |
| 17 | #include <boost/test/unit_test_log_formatter.hpp> |
| 18 | |
| 19 | #include <boost/test/utils/setcolor.hpp> |
| 20 | |
| 21 | #include <boost/test/detail/suppress_warnings.hpp> |
| 22 | |
| 23 | //____________________________________________________________________________// |
| 24 | |
| 25 | namespace boost { |
| 26 | namespace unit_test { |
| 27 | namespace output { |
| 28 | |
| 29 | // ************************************************************************** // |
| 30 | // ************** compiler_log_formatter ************** // |
| 31 | // ************************************************************************** // |
| 32 | |
| 33 | //!@brief Log formatter for the Human Readable Format (HRF) log format |
| 34 | class BOOST_TEST_DECL compiler_log_formatter : public unit_test_log_formatter { |
| 35 | public: |
| 36 | compiler_log_formatter() : m_color_output( false ), m_color_state() {} |
| 37 | |
| 38 | // Formatter interface |
| 39 | void log_start( std::ostream&, counter_t test_cases_amount ) BOOST_OVERRIDE; |
| 40 | void log_finish( std::ostream& ) BOOST_OVERRIDE; |
| 41 | void log_build_info( std::ostream&, bool ) BOOST_OVERRIDE; |
| 42 | |
| 43 | void test_unit_start( std::ostream&, test_unit const& tu ) BOOST_OVERRIDE; |
| 44 | void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ) BOOST_OVERRIDE; |
| 45 | void test_unit_skipped( std::ostream&, test_unit const& tu, const_string reason ) BOOST_OVERRIDE; |
| 46 | |
| 47 | void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex ) BOOST_OVERRIDE; |
| 48 | void log_exception_finish( std::ostream& ) BOOST_OVERRIDE; |
| 49 | |
| 50 | void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ) BOOST_OVERRIDE; |
| 51 | void log_entry_value( std::ostream&, const_string value ) BOOST_OVERRIDE; |
| 52 | void log_entry_value( std::ostream&, lazy_ostream const& value ) BOOST_OVERRIDE; |
| 53 | void log_entry_finish( std::ostream& ) BOOST_OVERRIDE; |
| 54 | |
| 55 | void entry_context_start( std::ostream&, log_level ) BOOST_OVERRIDE; |
| 56 | void log_entry_context( std::ostream&, log_level l, const_string ) BOOST_OVERRIDE; |
| 57 | void entry_context_finish( std::ostream&, log_level l ) BOOST_OVERRIDE; |
| 58 | |
| 59 | protected: |
| 60 | virtual void print_prefix( std::ostream&, const_string file, std::size_t line ); |
| 61 | |
| 62 | // Data members |
| 63 | bool m_color_output; |
| 64 | utils::setcolor::state m_color_state; |
| 65 | }; |
| 66 | |
| 67 | } // namespace output |
| 68 | } // namespace unit_test |
| 69 | } // namespace boost |
| 70 | |
| 71 | #include <boost/test/detail/enable_warnings.hpp> |
| 72 | |
| 73 | #endif // BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER |
| 74 | |