traverse.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 traverse_test_tree algorithm
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_TREE_TRAVERSE_HPP_100211GER
  14. #define BOOST_TEST_TREE_TRAVERSE_HPP_100211GER
  15. // Boost.Test
  16. #include <boost/test/detail/config.hpp>
  17. #include <boost/test/tree/test_unit.hpp>
  18. #include <boost/test/tree/visitor.hpp>
  19. #include <boost/test/detail/suppress_warnings.hpp>
  20. //____________________________________________________________________________//
  21. namespace boost {
  22. namespace unit_test {
  23. // ************************************************************************** //
  24. // ************** traverse_test_tree ************** //
  25. // ************************************************************************** //
  26. BOOST_TEST_DECL void traverse_test_tree( test_case const&, test_tree_visitor&, bool ignore_status = false );
  27. BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor&, bool ignore_status = false );
  28. BOOST_TEST_DECL void traverse_test_tree( test_unit_id , test_tree_visitor&, bool ignore_status = false );
  29. //____________________________________________________________________________//
  30. inline void
  31. traverse_test_tree( test_unit const& tu, test_tree_visitor& V, bool ignore_status = false )
  32. {
  33. if( tu.p_type == TUT_CASE )
  34. traverse_test_tree( static_cast<test_case const&>( tu ), V, ignore_status );
  35. else
  36. traverse_test_tree( static_cast<test_suite const&>( tu ), V, ignore_status );
  37. }
  38. //____________________________________________________________________________//
  39. } // namespace unit_test
  40. } // namespace boost
  41. #include <boost/test/detail/enable_warnings.hpp>
  42. #endif // BOOST_TEST_TREE_TRAVERSE_HPP_100211GER