compiler_log_formatter.hpp 2.7 KB

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