![]() |
Lumiera 0.pre.04
»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 221 of file activity-detector.hpp.
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... | |
Public Types | |
| using | SIG_post = activity::Proc(Time, Time, Activity *, FakeExecutionCtx &) |
| using | SIG_work = void(Time, size_t) |
| using | SIG_done = void(Time, size_t) |
| using | SIG_tick = activity::Proc(Time) |
Public Attributes | |
| FakeExecutionCtx | executionCtx {*this} |
Public Member Functions | |
| ActivityDetector (string id="") | |
| operator string () const | |
| string | showLog () const |
| void | clear (string newID) |
| uint | incrementSeq () |
| increment the internal invocation sequence number | |
| uint | currSeq () const |
| template<typename SIG > | |
| auto | buildDiagnosticFun (string id) |
| Generic testing helper: build a λ-mock, logging all invocations. | |
| JobClosure & | buildMockJobFunctor (string id) |
| Job | buildMockJob (string id="", Time nominal=lib::test::randTime(), size_t extra=rani()) |
| 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 | |
| Activity & | insertActivationTap (Activity *&wiring, string id="") |
| build ActivationProbe to record each activation before passing it to the subject | |
| Activity & | buildGateWatcher (Activity &gate, string id="") |
| Activity & | watchGate (Activity *&wiring, string id="") |
| Time | invokeTime (Activity const *hook) |
| bool | wasInvoked (Activity const *hook) |
| Time | invokeTime (Activity const &hook) |
| bool | wasInvoked (Activity const &hook) |
| ActivityMatch | verifyInvocation (string fun) |
| ActivityMatch | ensureNoInvocation (string fun) |
| ActivityMatch | verifySeqIncrement (uint seqNr) |
Private Types | |
| using | EventLog = lib::test::EventLog |
| using | Logger = _DiagnosticFun< void(string)>::Type |
Private Attributes | |
| EventLog | eventLog_ |
| uint | invocationSeq_ |
| std::deque< MockJobFunctor > | mockOps_ {} |
| std::deque< ActivityProbe > | mockActs_ {} |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
|
inline |
Definition at line 459 of file activity-detector.hpp.
| struct vault::gear::test::ActivityDetector::_DiagnosticFun |
|
private |
Definition at line 224 of file activity-detector.hpp.
|
private |
Definition at line 302 of file activity-detector.hpp.
| using SIG_post = activity::Proc(Time, Time, Activity*, FakeExecutionCtx&) |
Definition at line 587 of file activity-detector.hpp.
Definition at line 588 of file activity-detector.hpp.
Definition at line 589 of file activity-detector.hpp.
| using SIG_tick = activity::Proc(Time) |
Definition at line 590 of file activity-detector.hpp.
|
inline |
Definition at line 464 of file activity-detector.hpp.
References ActivityDetector::eventLog_, and util::join().
Here is the call graph for this function:
|
inline |
Definition at line 470 of file activity-detector.hpp.
References ActivityDetector::eventLog_, and util::join().
Here is the call graph for this function:
|
inline |
Definition at line 479 of file activity-detector.hpp.
References EventLog::clear(), and ActivityDetector::eventLog_.
Here is the call graph for this function:
|
inline |
increment the internal invocation sequence number
Definition at line 489 of file activity-detector.hpp.
References EventLog::event(), ActivityDetector::eventLog_, ActivityDetector::invocationSeq_, and util::toString().
Referenced by SchedulerActivity_test::dispatchChain(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerActivity_test::scenario_IOJob(), SchedulerActivity_test::scenario_Notification(), SchedulerService_test::scheduleRenderJob(), SchedulerActivity_test::verifyActivity_Gate_dead(), SchedulerActivity_test::verifyActivity_Gate_opened(), SchedulerActivity_test::verifyActivity_Notify(), ActivityDetector_test::verifyFakeExeContext(), ActivityDetector_test::verifyFakeInvocation(), ActivityDetector_test::verifyMockInvocation(), ActivityDetector_test::verifyMockJobFunctor(), ActivityDetector_test::watch_ActivationTap(), ActivityDetector_test::watch_gate(), and ActivityDetector_test::watch_notification().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 497 of file activity-detector.hpp.
References ActivityDetector::invocationSeq_.
Referenced by ActivityDetector_test::verifyMockInvocation().
Here is the caller graph for this function:
|
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 ActivityDetector::eventLog_, and ActivityDetector::invocationSeq_.
Referenced by ActivityDetector_test::simpleUsage(), ActivityDetector_test::verifyFakeInvocation(), and ActivityDetector_test::verifyMockInvocation().
Here is the caller graph for this function:
|
inline |
Definition at line 518 of file activity-detector.hpp.
References ActivityDetector::mockOps_.
Referenced by ActivityDetector::buildMockJob(), SchedulerActivity_test::verifyActivity_Invoke(), ActivityDetector_test::verifyMockJobFunctor(), and ActivityDetector_test::watch_ActivationTap().
Here is the caller graph for this function:
|
inline |
Definition at line 525 of file activity-detector.hpp.
References ActivityDetector::buildMockJobFunctor(), extra, InvocationInstanceID::part, and util::toString().
Referenced by SchedulerCommutator_test::integratedWorkCycle(), SchedulerActivity_test::scenario_IOJob(), SchedulerActivity_test::scenario_MetaJob(), SchedulerActivity_test::scenario_Notification(), SchedulerActivity_test::scenario_RenderJob(), SchedulerService_test::scheduleRenderJob(), and SchedulerActivity_test::termBuilder().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
build a rigged HOOK-Activity to record each invocation
Definition at line 539 of file activity-detector.hpp.
References ActivityDetector::eventLog_, ActivityDetector::invocationSeq_, and ActivityDetector::mockActs_.
Referenced by ActivityDetector::insertActivationTap(), SchedulerService_test::invokeWorkFunction(), ActivityDetector_test::watch_ActivationProbe(), and ActivityDetector::watchGate().
Here is the caller graph for this function:build ActivationProbe to record each activation before passing it to the subject
Definition at line 546 of file activity-detector.hpp.
References ActivityDetector::eventLog_, ActivityDetector::invocationSeq_, ActivityDetector::mockActs_, util::showAdr(), and Activity::showVerb().
Referenced by ActivityDetector::buildGateWatcher(), ActivityDetector::insertActivationTap(), and ActivityDetector_test::watch_ActivationTap().
Here is the call graph for this function:
Here is the caller graph for this function:build ActivationProbe to record each activation before passing it to the subject
Definition at line 557 of file activity-detector.hpp.
References ActivityDetector::buildActivationProbe(), ActivityDetector::buildActivationTap(), and util::showAdr().
Referenced by ActivityDetector::buildGateWatcher(), ActivityDetector_test::insert_ActivationTap(), SchedulerActivity_test::scenario_MetaJob(), SchedulerActivity_test::scenario_Notification(), and ActivityDetector_test::watch_notification().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 565 of file activity-detector.hpp.
References ActivityDetector::buildActivationTap(), ActivityDetector::insertActivationTap(), Activity::next, util::showAdr(), and Activity::showVerb().
Referenced by SchedulerActivity_test::verifyActivity_Gate_block(), SchedulerActivity_test::verifyActivity_Gate_dead(), SchedulerActivity_test::verifyActivity_Gate_notify(), SchedulerActivity_test::verifyActivity_Gate_opened(), SchedulerActivity_test::verifyActivity_Gate_pass(), and ActivityDetector::watchGate().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 572 of file activity-detector.hpp.
References ActivityDetector::buildActivationProbe(), ActivityDetector::buildGateWatcher(), and util::showAdr().
Referenced by SchedulerActivity_test::dispatchChain(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerActivity_test::scenario_Notification(), SchedulerActivity_test::scenario_RenderJob(), and ActivityDetector_test::watch_gate().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 580 of file activity-detector.hpp.
References ActivityDetector::ActivityProbe::lastInvoked().
Referenced by SchedulerService_test::invokeWorkFunction(), ActivityDetector::wasInvoked(), and ActivityDetector_test::watch_ActivationProbe().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 581 of file activity-detector.hpp.
References ActivityDetector::invokeTime(), and TimeValue::isRegular().
Referenced by ActivityDetector_test::watch_ActivationProbe().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 582 of file activity-detector.hpp.
References ActivityDetector::invokeTime().
Referenced by ActivityDetector::invokeTime().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 583 of file activity-detector.hpp.
References ActivityDetector::wasInvoked().
Referenced by ActivityDetector::wasInvoked().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 623 of file activity-detector.hpp.
References ActivityDetector::eventLog_, and EventLog::verifyCall().
Referenced by SchedulerCommutator_test::demonstrateSimpleUsage(), SchedulerActivity_test::dispatchChain(), ActivityDetector_test::insert_ActivationTap(), SchedulerActivity_test::scenario_IOJob(), SchedulerActivity_test::scenario_MetaJob(), SchedulerActivity_test::scenario_Notification(), SchedulerActivity_test::scenario_RenderJob(), SchedulerActivity_test::simpleUsage(), SchedulerActivity_test::termBuilder(), SchedulerActivity_test::verifyActivity_Gate_block(), SchedulerActivity_test::verifyActivity_Gate_dead(), SchedulerActivity_test::verifyActivity_Gate_notify(), SchedulerActivity_test::verifyActivity_Gate_opened(), SchedulerActivity_test::verifyActivity_Gate_pass(), SchedulerActivity_test::verifyActivity_Invoke(), SchedulerActivity_test::verifyActivity_Notify(), SchedulerActivity_test::verifyActivity_Post(), ActivityDetector_test::verifyFakeExeContext(), ActivityDetector_test::verifyFakeInvocation(), ActivityDetector_test::verifyMockInvocation(), ActivityDetector_test::verifyMockJobFunctor(), ActivityDetector_test::watch_ActivationProbe(), ActivityDetector_test::watch_ActivationTap(), ActivityDetector_test::watch_gate(), and ActivityDetector_test::watch_notification().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 629 of file activity-detector.hpp.
References EventLog::ensureNot(), ActivityDetector::eventLog_, and EventMatch::locateCall().
Referenced by SchedulerActivity_test::dispatchChain(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerActivity_test::scenario_IOJob(), SchedulerActivity_test::scenario_Notification(), SchedulerActivity_test::verifyActivity_Gate_opened(), ActivityDetector_test::verifyFakeExeContext(), ActivityDetector_test::verifyMockInvocation(), ActivityDetector_test::verifyMockJobFunctor(), and ActivityDetector_test::watch_ActivationTap().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 635 of file activity-detector.hpp.
References ActivityDetector::eventLog_, util::toString(), and EventLog::verifyEvent().
Referenced by SchedulerCommutator_test::integratedWorkCycle(), SchedulerService_test::scheduleRenderJob(), SchedulerActivity_test::verifyActivity_Gate_opened(), SchedulerActivity_test::verifyActivity_Notify(), ActivityDetector_test::verifyMockInvocation(), and ActivityDetector_test::watch_ActivationTap().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 226 of file activity-detector.hpp.
Referenced by ActivityDetector::buildActivationProbe(), ActivityDetector::buildActivationTap(), ActivityDetector::buildDiagnosticFun(), ActivityDetector::clear(), ActivityDetector::ensureNoInvocation(), ActivityDetector::incrementSeq(), ActivityDetector::operator string(), ActivityDetector::showLog(), ActivityDetector::verifyInvocation(), and ActivityDetector::verifySeqIncrement().
|
private |
Definition at line 227 of file activity-detector.hpp.
Referenced by ActivityDetector::buildActivationProbe(), ActivityDetector::buildActivationTap(), ActivityDetector::buildDiagnosticFun(), ActivityDetector::currSeq(), and ActivityDetector::incrementSeq().
|
private |
Definition at line 454 of file activity-detector.hpp.
Referenced by ActivityDetector::buildMockJobFunctor().
|
private |
Definition at line 455 of file activity-detector.hpp.
Referenced by ActivityDetector::buildActivationProbe(), and ActivityDetector::buildActivationTap().
| FakeExecutionCtx executionCtx {*this} |
Definition at line 618 of file activity-detector.hpp.
Referenced by ActivityDetector::ActivityProbe::activation(), SchedulerCommutator_test::demonstrateSimpleUsage(), SchedulerActivity_test::dispatchChain(), ActivityDetector_test::insert_ActivationTap(), SchedulerCommutator_test::integratedWorkCycle(), ActivityDetector::ActivityProbe::notify(), SchedulerActivity_test::scenario_IOJob(), SchedulerActivity_test::scenario_MetaJob(), SchedulerActivity_test::scenario_Notification(), SchedulerActivity_test::scenario_RenderJob(), SchedulerActivity_test::simpleUsage(), SchedulerActivity_test::termBuilder(), SchedulerActivity_test::verifyActivity_Gate_block(), SchedulerActivity_test::verifyActivity_Gate_dead(), SchedulerActivity_test::verifyActivity_Gate_notify(), SchedulerActivity_test::verifyActivity_Gate_opened(), SchedulerActivity_test::verifyActivity_Gate_pass(), SchedulerActivity_test::verifyActivity_Invoke(), SchedulerActivity_test::verifyActivity_Notify(), SchedulerActivity_test::verifyActivity_Post(), ActivityDetector_test::verifyFakeExeContext(), ActivityDetector_test::watch_ActivationProbe(), ActivityDetector_test::watch_ActivationTap(), ActivityDetector_test::watch_gate(), and ActivityDetector_test::watch_notification().
Inheritance diagram for ActivityDetector:
Collaboration diagram for ActivityDetector: