13#include "../asrtl/asrt_assert.h"
14#include "../asrtl/log.h"
15#include "../asrtl/status_to_str.h"
16#include "../asrtlpp/util.hpp"
17#include "../asrtr/reactor.h"
30template <
typename T >
33 template <
typename... Args >
34 unit( Args&&... args )
35 : test( (Args&&) args... )
37 asrt_test_init(
this, test.name(),
static_cast< unit*
>(
this ), unit::cb );
43 static asrt_status cb(
record* rec )
46 asrt_status st = self->test( *rec );
47 if ( st != ASRT_SUCCESS )
48 rec->
state = ASRT_TEST_FAIL;
57ASRT_NODISCARD
inline enum asrt_status
init(
58 ref< asrt_reactor > reac,
62 return asrt_reactor_init( reac, &req_l, desc );
67 return asrt_reactor_add_test( reac, &test );
71inline void deinit( ref< asrt_reactor > reac )
73 asrt_reactor_deinit( reac );
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: callback.hpp:17
ASRT_NODISCARD enum asrt_status init(ref< asrt_cntr_assm > assm, asrt_allocator alloc)
Initialise the controller assembly — wires controller, diag, param, collect and stream channels.
Definition: cntr_assm.hpp:25
ASRT_NODISCARD enum asrt_status add_test(ref< asrt_reac_assm > assm, asrt_test &test)
Append test to the assembly's reactor test list.
Definition: reac_assm.hpp:39
void deinit(ref< asrt_cntr_assm > assm)
Release all resources owned by the assembly.
Definition: cntr_assm.hpp:52
Test adaptor that wraps a synchronous callable T into an asrt_test.
Definition: reactor.hpp:32
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
Intrusive FIFO of outgoing send requests.
Definition: chann.h:76
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: reactor.h:35