File indexing completed on 2025-01-18 09:52:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER
0013 #define BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER
0014
0015
0016 #include <boost/test/detail/config.hpp>
0017 #include <boost/test/utils/class_properties.hpp>
0018
0019 #include <boost/test/tree/test_unit.hpp>
0020 #include <boost/test/tree/visitor.hpp>
0021
0022 #include <boost/test/detail/suppress_warnings.hpp>
0023
0024
0025
0026 namespace boost {
0027 namespace unit_test {
0028
0029
0030
0031
0032
0033
0034 class test_case_counter : public test_tree_visitor {
0035 public:
0036
0037
0038 test_case_counter(bool ignore_status = false)
0039 : p_count( 0 )
0040 , m_ignore_status(ignore_status)
0041 {}
0042
0043 BOOST_READONLY_PROPERTY( counter_t, (test_case_counter)) p_count;
0044 private:
0045
0046 void visit( test_case const& tc ) BOOST_OVERRIDE { if( m_ignore_status || tc.is_enabled() ) ++p_count.value; }
0047 bool test_suite_start( test_suite const& ts ) BOOST_OVERRIDE { return m_ignore_status || ts.is_enabled(); }
0048
0049 bool m_ignore_status;
0050 };
0051
0052 }
0053 }
0054
0055 #include <boost/test/detail/enable_warnings.hpp>
0056
0057 #endif
0058