xml_log_formatter.hpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 : $RCSfile$
  8. //
  9. // Version : $Revision$
  10. //
  11. // Description : contains OF_XML Log formatter definition
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_XML_LOG_FORMATTER_020105GER
  14. #define BOOST_TEST_XML_LOG_FORMATTER_020105GER
  15. // Boost.Test
  16. #include <boost/test/detail/global_typedef.hpp>
  17. #include <boost/test/unit_test_log_formatter.hpp>
  18. // STL
  19. #include <cstddef> // std::size_t
  20. #include <boost/test/detail/suppress_warnings.hpp>
  21. //____________________________________________________________________________//
  22. namespace boost {
  23. namespace unit_test {
  24. namespace output {
  25. // ************************************************************************** //
  26. // ************** xml_log_formatter ************** //
  27. // ************************************************************************** //
  28. class xml_log_formatter : public unit_test_log_formatter {
  29. public:
  30. // Formatter interface
  31. void log_start( std::ostream&, counter_t test_cases_amount );
  32. void log_finish( std::ostream& );
  33. void log_build_info( std::ostream&, bool );
  34. void test_unit_start( std::ostream&, test_unit const& tu );
  35. void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed );
  36. void test_unit_skipped( std::ostream&, test_unit const& tu, const_string reason );
  37. void log_exception_start( std::ostream&, log_checkpoint_data const&, execution_exception const& ex );
  38. void log_exception_finish( std::ostream& );
  39. void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let );
  40. using unit_test_log_formatter::log_entry_value; // bring base class functions into overload set
  41. void log_entry_value( std::ostream&, const_string value );
  42. void log_entry_finish( std::ostream& );
  43. void entry_context_start( std::ostream&, log_level );
  44. void log_entry_context( std::ostream&, log_level, const_string );
  45. void entry_context_finish( std::ostream&, log_level );
  46. private:
  47. // Data members
  48. const_string m_curr_tag;
  49. bool m_value_closed;
  50. };
  51. } // namespace output
  52. } // namespace unit_test
  53. } // namespace boost
  54. #include <boost/test/detail/enable_warnings.hpp>
  55. #endif // BOOST_TEST_XML_LOG_FORMATTER_020105GER