progress_monitor.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // (C) Copyright Gennadiy Rozental 2005-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)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. // File : $RCSfile$
  8. //
  9. // Version : $Revision: 49312 $
  10. //
  11. // Description : defines simple text based progress monitor
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
  14. #define BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
  15. // Boost.Test
  16. #include <boost/test/test_observer.hpp>
  17. #include <boost/test/utils/trivial_singleton.hpp>
  18. // STL
  19. #include <iosfwd> // for std::ostream&
  20. #include <boost/test/detail/suppress_warnings.hpp>
  21. //____________________________________________________________________________//
  22. namespace boost {
  23. namespace unit_test {
  24. // ************************************************************************** //
  25. // ************** progress_monitor ************** //
  26. // ************************************************************************** //
  27. class BOOST_TEST_DECL progress_monitor_t : public test_observer, public singleton<progress_monitor_t> {
  28. public:
  29. // test observer interface
  30. void test_start( counter_t test_cases_amount );
  31. void test_finish() {}
  32. void test_aborted();
  33. void test_unit_start( test_unit const& ) {}
  34. void test_unit_finish( test_unit const&, unsigned long );
  35. void test_unit_skipped( test_unit const& );
  36. void test_unit_aborted( test_unit const& ) {}
  37. void assertion_result( bool ) {}
  38. void exception_caught( execution_exception const& ) {}
  39. // configuration
  40. void set_stream( std::ostream& );
  41. private:
  42. BOOST_TEST_SINGLETON_CONS( progress_monitor_t );
  43. }; // progress_monitor_t
  44. BOOST_TEST_SINGLETON_INST( progress_monitor )
  45. } // namespace unit_test
  46. } // namespace boost
  47. //____________________________________________________________________________//
  48. #include <boost/test/detail/enable_warnings.hpp>
  49. #endif // BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER