20 #ifndef TEST_UNIT_TEST_MULTI_RUNNER_H
21 #define TEST_UNIT_TEST_MULTI_RUNNER_H
23 #include <ripple/beast/unit_test/global_suites.hpp>
24 #include <ripple/beast/unit_test/runner.hpp>
25 #include <boost/beast/core/static_string.hpp>
27 #include <boost/container/static_vector.hpp>
28 #include <boost/interprocess/ipc/message_queue.hpp>
29 #include <boost/interprocess/mapped_region.hpp>
30 #include <boost/interprocess/shared_memory_object.hpp>
31 #include <boost/interprocess/sync/interprocess_mutex.hpp>
89 boost::container::static_vector<run_time, max_top>
top;
103 template <
bool IsParent>
120 mutable boost::interprocess::interprocess_mutex
m_;
159 "RippledUnitTestMessageQueue";
286 template <
class Pred>
292 on_suite_begin(beast::unit_test::suite_info
const& info)
override;
315 template <
class Pred>
319 auto const& suite = beast::unit_test::global_suites();
320 auto const num_tests = suite.size();
323 auto get_test = [&]() -> beast::unit_test::suite_info
const* {
325 if (cur_test_index >= num_tests)
327 auto iter = suite.begin();
331 while (
auto t = get_test())
337 failed = run(*t) || failed;
346 s <<
job_index_ <<
"> failed Unhandled exception in test.\n";
std::size_t suites() const
std::size_t checkout_test_index()
bool run_multi(Pred pred)
void add_failures(std::size_t failures)
multi_runner_parent & operator=(multi_runner_parent const &)=delete
void inc_keep_alive_count()
suite_results(std::string name_="")
static constexpr const char * shared_mem_name_
std::size_t get_keep_alive_count()
boost::interprocess::shared_memory_object shared_mem_
void add(results const &r)
std::size_t checkout_test_index()
clock_type::time_point start
boost::interprocess::mapped_region region_
std::set< std::string > running_suites_
std::atomic< bool > continue_keep_alive_
void message_queue_send(MessageType mt, std::string const &s)
boost::interprocess::interprocess_mutex m_
virtual void on_suite_end() override
std::size_t tests() const
std::atomic< std::size_t > job_index_
void add(suite_results const &r)
std::atomic< std::size_t > keep_alive_
std::size_t suites() const
case_results(std::string name_="")
std::atomic< std::size_t > test_index_
virtual void on_suite_begin(beast::unit_test::suite_info const &info) override
void add_failures(std::size_t failures)
std::size_t suites() const
std::atomic< bool > continue_message_queue_
std::size_t checkout_job_index()
detail::suite_results suite_results_
std::size_t checkout_job_index()
void add(results const &r)
virtual void on_log(std::string const &s) override
void add_failures(std::size_t failures)
detail::case_results case_results_
void add(case_results const &r)
std::size_t suites() const
clock_type::time_point start
virtual void on_case_end() override
std::thread message_queue_thread_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual void on_pass() override
virtual void on_fail(std::string const &reason) override
void merge(results const &r)
boost::container::static_vector< run_time, max_top > top
multi_runner_child & operator=(multi_runner_child const &)=delete
std::size_t tests() const
std::size_t tests() const
static constexpr const char * message_queue_name_
std::size_t tests() const
A class to run a subset of unit tests.
std::atomic< bool > any_failed_
multi_runner_child(multi_runner_child const &)=delete
void inc_keep_alive_count()
boost::beast::static_string< 256 > static_string
Manager for children running unit tests.
virtual void on_case_begin(std::string const &name) override
std::unique_ptr< boost::interprocess::message_queue > message_queue_
std::size_t get_keep_alive_count()
std::thread keep_alive_thread_