Lumiera
0.pre.03
»edit your freedom«
|
#include "/Werk/devel/lumi/tests/vault/gear/activity-detector.hpp"
Diagnostic context to record and evaluate activations within the Scheduler.
The provided tools and detectors are wired back internally, such as to record any observations into an lib::test::EventLog instance. Thus, after performing rigged functionality, the expected activities and their order can be verified.
Definition at line 220 of file activity-detector.hpp.
Public Types | |
using | SIG_done = void(Time, size_t) |
using | SIG_post = activity::Proc(Time, Time, Activity *, FakeExecutionCtx &) |
using | SIG_tick = activity::Proc(Time) |
using | SIG_work = void(Time, size_t) |
Public Member Functions | |
ActivityDetector (string id="") | |
Activity & | buildActivationProbe (string id) |
build a rigged HOOK-Activity to record each invocation | |
Activity & | buildActivationTap (Activity const &subject, string id="") |
build ActivationProbe to record each activation before passing it to the subject | |
template<typename SIG > | |
auto | buildDiagnosticFun (string id) |
Generic testing helper: build a λ-mock, logging all invocations. More... | |
Activity & | buildGateWatcher (Activity &gate, string id="") |
Job | buildMockJob (string id="", Time nominal=lib::test::randTime(), size_t extra=rani()) |
JobClosure & | buildMockJobFunctor (string id) |
void | clear (string newID) |
uint | currSeq () const |
ActivityMatch | ensureNoInvocation (string fun) |
uint | incrementSeq () |
increment the internal invocation sequence number | |
Activity & | insertActivationTap (Activity *&wiring, string id="") |
build ActivationProbe to record each activation before passing it to the subject | |
Time | invokeTime (Activity const *hook) |
Time | invokeTime (Activity const &hook) |
operator string () const | |
string | showLog () const |
ActivityMatch | verifyInvocation (string fun) |
ActivityMatch | verifySeqIncrement (uint seqNr) |
bool | wasInvoked (Activity const *hook) |
bool | wasInvoked (Activity const &hook) |
Activity & | watchGate (Activity *&wiring, string id="") |
Public Attributes | |
FakeExecutionCtx | executionCtx {*this} |
Classes | |
struct | _DiagnosticFun |
class | ActivityProbe |
A rigged CALLBACK-Activity to watch passing of activations. More... | |
class | DiagnosticFun |
A Mock functor, logging all invocations into the EventLog. More... | |
struct | FakeExecutionCtx |
Mock setup of the execution context for Activity activation. More... | |
class | MockJobFunctor |
A Mocked job operation to detect any actual invocation. More... | |
Private Types | |
using | EventLog = lib::test::EventLog |
using | Logger = _DiagnosticFun< void(string)>::Type |
Private Attributes | |
EventLog | eventLog_ |
uint | invocationSeq_ |
std::deque< ActivityProbe > | mockActs_ {} |
std::deque< MockJobFunctor > | mockOps_ {} |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
struct vault::gear::test::ActivityDetector::_DiagnosticFun |
Class Members | ||
---|---|---|
typedef typename _Fun< SIG >::Ret | Ret | |
typedef typename _Fun< SIG >::Args | Args | |
typedef typename StripNullType < Args >::Seq |
ArgsX | |
typedef typename Prepend< Ret, ArgsX >::Seq |
SigTypes | |
typedef typename RebindVariadic< DiagnosticFun, SigTypes >::Type |
Type |
|
inline |
Generic testing helper: build a λ-mock, logging all invocations.
SIG | signature of the functor to be generated |
id | human readable ID, to designate invocations in the log |
Definition at line 511 of file activity-detector.hpp.
References EventMatch::id().
Referenced by ActivityDetector_test::simpleUsage().