visitor.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 : $RCSfile$
  8. //
  9. // Version : $Revision: -1 $
  10. //
  11. // Description : defines test_tree_visitor
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_TREE_VISITOR_HPP_100211GER
  14. #define BOOST_TEST_TREE_VISITOR_HPP_100211GER
  15. // Boost.Test
  16. #include <boost/test/detail/config.hpp>
  17. #include <boost/test/tree/test_unit.hpp>
  18. #include <boost/test/detail/suppress_warnings.hpp>
  19. //____________________________________________________________________________//
  20. namespace boost {
  21. namespace unit_test {
  22. // ************************************************************************** //
  23. // ************** test_tree_visitor ************** //
  24. // ************************************************************************** //
  25. class BOOST_TEST_DECL test_tree_visitor {
  26. public:
  27. // test tree visitor interface
  28. virtual bool visit( test_unit const& ) { return true; }
  29. virtual void visit( test_case const& tc ) { visit( (test_unit const&)tc ); }
  30. virtual bool test_suite_start( test_suite const& ts ){ return visit( (test_unit const&)ts ); }
  31. virtual void test_suite_finish( test_suite const& ) {}
  32. protected:
  33. BOOST_TEST_PROTECTED_VIRTUAL ~test_tree_visitor() {}
  34. };
  35. } // namespace unit_test
  36. } // namespace boost
  37. #include <boost/test/detail/enable_warnings.hpp>
  38. #endif // BOOST_TEST_TREE_VISITOR_HPP_100211GER