progress_monitor.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 defines simple text based progress monitor
  9. // ***************************************************************************
  10. #ifndef BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
  11. #define BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
  12. // Boost.Test
  13. #include <boost/test/tree/observer.hpp>
  14. // STL
  15. #include <iosfwd> // for std::ostream&
  16. #include <boost/test/detail/suppress_warnings.hpp>
  17. //____________________________________________________________________________//
  18. namespace boost {
  19. namespace unit_test {
  20. // ************************************************************************** //
  21. // ************** progress_monitor ************** //
  22. // ************************************************************************** //
  23. /// This class implements test observer interface and updates test progress as test units finish or get aborted
  24. class BOOST_TEST_DECL progress_monitor_t : public test_observer {
  25. public:
  26. /// @name Test observer interface
  27. /// @{
  28. void test_start( counter_t test_cases_amount, test_unit_id ) BOOST_OVERRIDE;
  29. void test_aborted() BOOST_OVERRIDE;
  30. void test_unit_finish( test_unit const&, unsigned long ) BOOST_OVERRIDE;
  31. void test_unit_skipped( test_unit const&, const_string ) BOOST_OVERRIDE;
  32. int priority() BOOST_OVERRIDE { return 4; }
  33. /// @}
  34. /// @name Configuration
  35. /// @{
  36. void set_stream( std::ostream& );
  37. /// @}
  38. /// Singleton pattern
  39. BOOST_TEST_SINGLETON_CONS( progress_monitor_t )
  40. }; // progress_monitor_t
  41. BOOST_TEST_SINGLETON_INST( progress_monitor )
  42. } // namespace unit_test
  43. } // namespace boost
  44. //____________________________________________________________________________//
  45. #include <boost/test/detail/enable_warnings.hpp>
  46. #endif // BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER