]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/test/writing-test-ts/test-timeout-suite.cpp
1 // (C) Copyright Raffi Enficiaud, 2019
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)
6 // See http://www.boost.org/libs/test for the library home page.
8 #define BOOST_TEST_MODULE timeout-error-suite
9 #include <boost/test/unit_test.hpp>
10 #include <boost/test/data/test_case.hpp>
14 namespace utf
= boost::unit_test
;
16 // each of the test case of the data set has a timeout of 1 sec
17 BOOST_TEST_DECORATOR(* utf::timeout(1))
18 BOOST_DATA_TEST_CASE(test_success
, utf::data::make({0,1,2,3}))
20 std::this_thread::sleep_for(std::chrono::milliseconds(100));
21 BOOST_TEST(sample
>= 0);
24 // the full test suite has a timeout of 1s
25 BOOST_TEST_DECORATOR(* utf::timeout(1))
27 BOOST_AUTO_TEST_SUITE(test_suite_success
)
28 BOOST_DATA_TEST_CASE(test_success
, utf::data::make({0,1,2,3,4,5,6,7}))
30 std::this_thread::sleep_for(std::chrono::milliseconds(100));
31 BOOST_TEST(sample
>= 0);
33 BOOST_AUTO_TEST_SUITE_END()