]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/test/test/framework-ts/result-report-test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / test / test / framework-ts / result-report-test.cpp
index 933a27b004b116294911eeeca604f4ab641bc2d4..c43bc65cdbaf6b4f298dfa4aa3c60bc852e2b959 100644 (file)
@@ -23,6 +23,7 @@
 #include <boost/test/framework.hpp>
 #include <boost/test/unit_test_parameters.hpp>
 #include <boost/test/utils/nullstream.hpp>
+#include <boost/test/execution_monitor.hpp>
 typedef boost::onullstream onullstream_type;
 
 // BOOST
@@ -56,12 +57,26 @@ struct log_guard {
 
 void very_bad_foo()  {
     log_guard lg;
-    ut_detail::ignore_unused_variable_warning( lg );
+    boost::ignore_unused( lg );
     onullstream_type null_out;
     unit_test_log.set_stream( null_out );
     BOOST_FAIL( "" );
 }
 
+void timeout_foo()
+{
+    log_guard lg;
+    boost::ignore_unused( lg );
+    onullstream_type null_out;
+    unit_test_log.set_stream( null_out );
+    using boost::execution_exception;
+    execution_exception::location dummy;
+    throw execution_exception(
+          execution_exception::timeout_error,
+          "fake  timeout",
+          dummy);
+}
+
 //____________________________________________________________________________//
 
 void check( output_test_stream& output, output_format report_format, test_unit_id id )
@@ -112,7 +127,7 @@ struct guard {
 BOOST_AUTO_TEST_CASE( test_result_reports )
 {
     guard G;
-    ut_detail::ignore_unused_variable_warning( G );
+    boost::ignore_unused( G );
 
 #define PATTERN_FILE_NAME "result_report_test.pattern"
 
@@ -159,6 +174,20 @@ BOOST_AUTO_TEST_CASE( test_result_reports )
         i_have_problems->p_name.set("bad_foo<h>");
         ts_char_escaping->add( i_have_problems );
 
+    test_suite* ts_timeout = BOOST_TEST_SUITE( "Timeout" );
+        ts_timeout->add( BOOST_TEST_CASE( good_foo ) );
+        test_case * tc_timeout = BOOST_TEST_CASE( timeout_foo );
+        ts_timeout->add( tc_timeout );
+
+    test_suite* ts_timeout_nested = BOOST_TEST_SUITE( "Timeout-nested" );
+        ts_timeout_nested->add( BOOST_TEST_CASE( good_foo ) );
+        test_suite* ts_timeout_internal = BOOST_TEST_SUITE( "Timeout" );
+          ts_timeout_internal->add( BOOST_TEST_CASE( good_foo ) );
+          test_case * tc_timeout_internal = BOOST_TEST_CASE( timeout_foo );
+          ts_timeout_internal->add( tc_timeout_internal );
+        ts_timeout_nested->add( ts_timeout_internal );
+        ts_timeout_nested->add( BOOST_TEST_CASE_NAME( good_foo, "good_foo2" ) );
+
     check( test_output, ts_1 );
 
     check( test_output, ts_1b );
@@ -175,6 +204,10 @@ BOOST_AUTO_TEST_CASE( test_result_reports )
 
     check( test_output, ts_char_escaping );
 
+    check( test_output, ts_timeout );
+
+    check( test_output, ts_timeout_nested );
+
     results_reporter::set_stream( std::cout );
 }
 
@@ -266,7 +299,7 @@ void check2( output_test_stream& output, test_suite* ts )
 BOOST_AUTO_TEST_CASE( test_result_reports_default_behaviour )
 {
     guard G;
-    ut_detail::ignore_unused_variable_warning( G );
+    boost::ignore_unused( G );
 
 #define PATTERN_FILE_NAME_DEFAULT_BEHAVIOUR "result_report_test.pattern.default_behaviour"
 
@@ -313,6 +346,20 @@ BOOST_AUTO_TEST_CASE( test_result_reports_default_behaviour )
         i_have_problems->p_name.set("bad_foo<h>");
         ts_char_escaping->add( i_have_problems );
 
+    test_suite* ts_timeout = BOOST_TEST_SUITE( "Timeout" );
+        ts_timeout->add( BOOST_TEST_CASE( good_foo ) );
+        test_case * tc_timeout = BOOST_TEST_CASE( timeout_foo );
+        ts_timeout->add( tc_timeout );
+
+    test_suite* ts_timeout_nested = BOOST_TEST_SUITE( "Timeout-nested" );
+        ts_timeout_nested->add( BOOST_TEST_CASE( good_foo ) );
+        test_suite* ts_timeout_internal = BOOST_TEST_SUITE( "Timeout" );
+          ts_timeout_internal->add( BOOST_TEST_CASE( good_foo ) );
+          test_case * tc_timeout_internal = BOOST_TEST_CASE( timeout_foo );
+          ts_timeout_internal->add( tc_timeout_internal );
+        ts_timeout_nested->add( ts_timeout_internal );
+        ts_timeout_nested->add( BOOST_TEST_CASE_NAME( good_foo, "good_foo2" ) );
+
     check2( test_output, ts_1 );
 
     check2( test_output, ts_1b );
@@ -329,6 +376,10 @@ BOOST_AUTO_TEST_CASE( test_result_reports_default_behaviour )
 
     check2( test_output, ts_char_escaping );
 
+    check2( test_output, ts_timeout );
+
+    check2( test_output, ts_timeout_nested );
+
     results_reporter::set_stream( std::cout );
 }