test_framework_init_observer.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, test_unit_id );
  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. private:
  37. bool m_has_failure;
  38. };
  39. } // namespace unit_test
  40. } // namespace boost
  41. #include <boost/test/detail/enable_warnings.hpp>
  42. #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER