8#include <userver/engine/task/task_processor_fwd.hpp>
9#include <userver/formats/json/value.hpp>
10#include <userver/utils/function_ref.hpp>
12USERVER_NAMESPACE_BEGIN
26bool IsTestpointEnabled(std::string_view name)
noexcept;
28void ExecuteTestpointCoro(std::string_view name,
29 const formats::
json::Value& json,
30 TestpointCallback callback);
32void ExecuteTestpointBlocking(std::string_view name,
33 const formats::
json::Value& json,
34 TestpointCallback callback,
35 engine::TaskProcessor& task_processor);
37void DoNothing(
const formats::
json::Value&)
noexcept;
60#define TESTPOINT_CALLBACK(name, json, callback)
63 !USERVER_NAMESPACE
::testsuite::AreTestpointsAvailable(), true))
67 const auto& userver_impl_tp_name = name;
68 if (!USERVER_NAMESPACE
::testsuite::impl::IsTestpointEnabled(
69 userver_impl_tp_name))
72 USERVER_NAMESPACE
::testsuite::impl::ExecuteTestpointCoro(
73 userver_impl_tp_name, json, callback);
92#define TESTPOINT(name, json)
103#define TESTPOINT_CALLBACK_NONCORO(name, json, task_processor, callback)
105 if (__builtin_expect(
106 !USERVER_NAMESPACE
::testsuite::AreTestpointsAvailable(), true))
110 const auto& userver_impl_tp_name = name;
111 if (!USERVER_NAMESPACE
::testsuite::impl::IsTestpointEnabled(
112 userver_impl_tp_name))
115 USERVER_NAMESPACE
::testsuite::impl::ExecuteTestpointBlocking(
116 userver_impl_tp_name, json, callback, task_processor);
127#define TESTPOINT_NONCORO(name, json, task_processor)
129 USERVER_NAMESPACE
::testsuite::impl::DoNothing)