test_framework_init_observer.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // (c) Copyright Raffi Enficiaud 2017.
  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 an observer that monitors the init of the unit test framework
  9. // ***************************************************************************
  10. #ifndef BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER
  11. #define BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER
  12. // Boost.Test
  13. #include <boost/test/tree/observer.hpp>
  14. #include <boost/test/detail/global_typedef.hpp>
  15. #include <boost/test/detail/fwd_decl.hpp>
  16. #include <boost/test/detail/suppress_warnings.hpp>
  17. //____________________________________________________________________________//
  18. namespace boost {
  19. namespace unit_test {
  20. // ************************************************************************** //
  21. /// @brief Monitors the init of the framework
  22. ///
  23. /// This class collects the state of the init/termination of the unit test framework.
  24. ///
  25. /// @see boost::unit_test::test_observer
  26. class BOOST_TEST_DECL framework_init_observer_t : public test_observer {
  27. public:
  28. virtual void test_start( counter_t );
  29. virtual void assertion_result( unit_test::assertion_result );
  30. virtual void exception_caught( execution_exception const& );
  31. virtual void test_aborted();
  32. virtual int priority() { return 0; }
  33. void clear();
  34. /// Indicates if a failure has been recorded so far
  35. bool has_failed( ) const;
  36. /// Singleton pattern
  37. BOOST_TEST_SINGLETON_CONS( framework_init_observer_t )
  38. };
  39. BOOST_TEST_SINGLETON_INST( framework_init_observer )
  40. } // namespace unit_test
  41. } // namespace boost
  42. #include <boost/test/detail/enable_warnings.hpp>
  43. #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER