13#include "../asrtlpp/task.hpp"
14#include "./reactor.hpp"
16#include <ecor/ecor.hpp>
31 template <
typename T >
34 return _ctx.query( (T&&) q );
42using ecor::with_error;
50template <
typename T >
56 using receiver_concept = ecor::receiver_t;
60 void set_value() { rec->
state = ASRT_TEST_PASS; }
61 void set_error( ecor::task_error ) { rec->
state = ASRT_TEST_FAIL; }
63 void set_error( asrt::status ) { rec->
state = ASRT_TEST_ERROR; }
64 void set_stopped() { rec->
state = ASRT_TEST_FAIL; }
68 : _def( std::move( def ) )
70 asrt_test_init(
this, _def.name,
static_cast< task_unit*
>(
this ), task_unit::cb );
73 static asrt_status cb(
record* rec )
77 if ( rec->
state == ASRT_TEST_INIT ) {
78 rec->
state = ASRT_TEST_RUNNING;
79 self._op = self._def.exec().connect( recv{ rec } );
89 ecor::connect_type< task< void >, recv > _op;
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: callback.hpp:17
Event-loop context that owns a coroutine task scheduler.
Definition: task.hpp:30
Coroutine context object passed to task tests.
Definition: task_unit.hpp:25
Definition: task_unit.hpp:55
Coroutine test adaptor that wraps a definition type T into an asrt_test driven by an ecor coroutine.
Definition: task_unit.hpp:52
Mutable test state passed to the test entry point on every tick.
Definition: record.h:46
struct asrt_test_input const * inpt
Immutable per-invocation context.
Definition: record.h:49
enum asrt_test_state state
Current state; updated by assertions and by the reactor.
Definition: record.h:47
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: reactor.h:35