20#ifndef ORES_TESTING_DATABASE_RUN_COROUTINE_TEST_HPP
21#define ORES_TESTING_DATABASE_RUN_COROUTINE_TEST_HPP
23#include <boost/asio/co_spawn.hpp>
24#include <boost/asio/detached.hpp>
25#include <boost/asio/io_context.hpp>
26#include <catch2/catch_test_macros.hpp>
30template <
typename Awaitable>
31void run_coroutine_test(boost::asio::io_context& io_context, Awaitable&& awaitable) {
32 bool completed =
false;
33 boost::asio::co_spawn(io_context, [&]() -> boost::asio::awaitable<void> {
34 co_await std::forward<Awaitable>(awaitable)();
36 }, boost::asio::detached);
Testing infrastructure common to all test projects.
Definition database_helper.hpp:27