test_observer.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 abstract interface for test observer
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_TEST_OBSERVER_HPP_021005GER
  14. #define BOOST_TEST_TEST_OBSERVER_HPP_021005GER
  15. // Boost.Test
  16. #include <boost/test/detail/fwd_decl.hpp>
  17. #include <boost/test/detail/global_typedef.hpp>
  18. #include <boost/test/detail/config.hpp>
  19. #include <boost/test/detail/suppress_warnings.hpp>
  20. //____________________________________________________________________________//
  21. namespace boost {
  22. namespace unit_test {
  23. // ************************************************************************** //
  24. // ************** test_observer ************** //
  25. // ************************************************************************** //
  26. class BOOST_TEST_DECL test_observer {
  27. public:
  28. // test observer interface
  29. virtual void test_start( counter_t /* test_cases_amount */ ) {}
  30. virtual void test_finish() {}
  31. virtual void test_aborted() {}
  32. virtual void test_unit_start( test_unit const& ) {}
  33. virtual void test_unit_finish( test_unit const&, unsigned long /* elapsed */ ) {}
  34. virtual void test_unit_skipped( test_unit const& ) {}
  35. virtual void test_unit_aborted( test_unit const& ) {}
  36. virtual void assertion_result( bool /* passed */ ) {}
  37. virtual void exception_caught( execution_exception const& ) {}
  38. virtual int priority() { return 0; }
  39. protected:
  40. BOOST_TEST_PROTECTED_VIRTUAL ~test_observer() {}
  41. };
  42. } // unit_test
  43. } // namespace boost
  44. //____________________________________________________________________________//
  45. #include <boost/test/detail/enable_warnings.hpp>
  46. #endif // BOOST_TEST_TEST_OBSERVER_HPP_021005GER