![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/test/event-log.hpp"
ongoing evaluation and match within an [EventLog].
Definition at line 120 of file event-log.hpp.
Public Member Functions | |
| operator bool () const | |
final evaluation of the match query, usually triggered from the unit test CHECK(). | |
| EventMatch & | locate (string match) |
| basic search function: continue linear lookup over the elements of the EventLog to find a match (substring match) of the given text. | |
| EventMatch & | locateMatch (string regExp) |
| basic search like locate() but with the given regular expression | |
| EventMatch & | locateEvent (string match) |
| basic search for a matching "event" | |
| EventMatch & | locateEvent (string classifier, string match) |
| EventMatch & | locateCall (string match) |
| basic search for some specific function invocation | |
| EventMatch & | before (string match) |
| find a match (substring match) of the given text in an EventLog entry after the current position | |
| EventMatch & | beforeMatch (string regExp) |
| find a match with the given regular expression | |
| EventMatch & | beforeEvent (string match) |
| find a match for an "event" after the current point of reference | |
| EventMatch & | beforeEvent (string classifier, string match) |
| EventMatch & | beforeCall (string match) |
| find a match for some function invocation after the current point of reference | |
| EventMatch & | after (string match) |
| find a match (substring match) of the given text in an EventLog entry before the current position, switching to backwards search direction | |
| EventMatch & | afterMatch (string regExp) |
| EventMatch & | afterEvent (string match) |
| EventMatch & | afterEvent (string classifier, string match) |
| EventMatch & | afterCall (string match) |
| find a function invocation backwards, before the current point of reference | |
| template<typename... ARGS> | |
| EventMatch & | arg (ARGS const &...args) |
| refine filter to additionally require specific arguments | |
| template<typename... ARGS> | |
| EventMatch & | argMatch (ARGS const &...regExps) |
| refine filter to additionally cover all arguments with a series of regular expressions. | |
| template<typename ARG > | |
| EventMatch & | argPos (size_t idx, ARG const &arg) |
| refine filter to additionally require match on a specific positional argument | |
| EventMatch & | type (string typeID) |
| refine filter to additionally require a matching log entry type | |
| EventMatch & | key (string key) |
| refine filter to additionally require the presence an attribute | |
| EventMatch & | attrib (string key, string valueMatch) |
| refine filter to additionally match on a specific attribute | |
| EventMatch & | id (string classifier) |
| refine filter to additionally match on the ID attribute | |
| EventMatch & | on (string targetID) |
| refine filter to additionally match the ‘'this’` attribute | |
| EventMatch & | on (CStr targetID) |
| template<typename X > | |
| EventMatch & | on (const X *const targetObj) |
Friends | |
| class | EventLog |
Private Types | |
| using | Filter = decltype(buildSearchFilter(std::declval< Log const & >())) |
| using | ArgSeq = lib::diff::RecordSetup< string >::Storage |
| using | RExSeq = std::vector< std::regex > |
Private Member Functions | |
| EventMatch (Log const &srcSeq) | |
| bool | foundSolution () |
| core of the evaluation machinery: apply a filter predicate and then pull through the log to find a acceptable entry | |
| void | evaluateQuery (string matchSpec, Literal rel="after") |
| this is actually called after each refinement of the filter and matching conditions. | |
| void | refineSerach_matchArgument (size_t idx, string match) |
| void | refineSerach_matchArguments (ArgSeq &&argSeq) |
| void | refineSerach_matchArgsRegExp (RExSeq &®ExpSeq, string rendered_regExps) |
Private Attributes | |
| Filter | solution_ |
| match predicate evaluator | |
| string | lastMatch_ |
| record last match for diagnostics | |
| bool | look_for_match_ |
| support for positive and negative queries. | |
| string | violation_ |
| record when the underlying query has failed | |
|
private |
for creating EventLog matchers
Definition at line 258 of file event-log.cpp.
|
private |
Definition at line 122 of file event-log.hpp.
|
private |
Definition at line 124 of file event-log.hpp.
|
private |
Definition at line 125 of file event-log.hpp.
|
inline |
final evaluation of the match query, usually triggered from the unit test CHECK().
Definition at line 153 of file event-log.hpp.
References util::isnil(), and EventMatch::violation_.
Here is the call graph for this function:| EventMatch & locate | ( | string | match | ) |
basic search function: continue linear lookup over the elements of the EventLog to find a match (substring match) of the given text.
The search begins at the current position and proceeds in the currently configured direction. Initially the search starts at the first record and proceeds forward.
Definition at line 321 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog::ensureNot(), EventLog::verify(), and EventLog_test::verify_backwardMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & locateMatch | ( | string | regExp | ) |
basic search like locate() but with the given regular expression
Definition at line 332 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog::verifyMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & locateEvent | ( | string | match | ) |
basic search for a matching "event"
| match | perform a substring match against the arguments of the event |
Definition at line 345 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog::verifyEvent(), and EventLog::verifyEvent().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & locateEvent | ( | string | classifier, |
| string | match | ||
| ) |
Definition at line 353 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Here is the call graph for this function:| EventMatch & locateCall | ( | string | match | ) |
basic search for some specific function invocation
| match | perform a substring match against the name of the function invoked |
Definition at line 365 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by ActivityDetector::ensureNoInvocation(), and EventLog::verifyCall().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & before | ( | string | match | ) |
find a match (substring match) of the given text in an EventLog entry after the current position
log.verify("α").before("β"). Operationally this means first to find a Record matching the substring "α" and then to forward from this point until hitting a record to match "β". Definition at line 384 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by TestTracking_test::demonstrate_checkAllocator(), TreeMutatorBinding_test::mutateDummy(), AbstractTangible_test::notify(), EventLog_test::verify_backwardMatch(), EventLog_test::verify_callLogging(), EventLog_test::verify_eventLogging(), EventLog_test::verify_genericLogging(), EventLog_test::verify_logJoining(), AbstractTangible_test::verify_mockManipulation(), EventLog_test::verify_negatedMatch(), EventLog_test::verify_regExpMatch(), and EventLog_test::verify_simpleUsage().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & beforeMatch | ( | string | regExp | ) |
find a match with the given regular expression
Definition at line 395 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog_test::verify_regExpMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & beforeEvent | ( | string | match | ) |
find a match for an "event" after the current point of reference
eventerrorcreatedestroylogJoin | match | perform a substring match against the arguments of the event |
Definition at line 417 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by BusTerm_test::attachNewBusTerm(), ActivityMatch::beforeSeqIncrement(), TestTracking_test::demonstrate_checkAllocator(), TestTracking_test::demonstrate_logObject(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), TreeMutatorBinding_test::mutateDummy(), AbstractTangible_test::revealer(), LateBindInstance_test::verify_forwarding(), EventLog_test::verify_genericLogging(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasInvoked(), and Nexus::wasInvoked().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & beforeEvent | ( | string | classifier, |
| string | match | ||
| ) |
Definition at line 425 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Here is the call graph for this function:| EventMatch & beforeCall | ( | string | match | ) |
find a match for some function invocation after the current point of reference
| match | perform a substring match against the name of the function invoked |
Definition at line 438 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by BusTerm_test::attachNewBusTerm(), TestTracking_test::demonstrate_checkAllocator(), TestTracking_test::demonstrate_logObject(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), BusTerm_test::pushDiff(), AbstractTangible_test::revealer(), EventLog_test::verify_eventLogging(), LateBindInstance_test::verify_forwarding(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasBound(), Nexus::wasInvoked(), and Nexus::wasInvoked().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & after | ( | string | match | ) |
find a match (substring match) of the given text in an EventLog entry before the current position, switching to backwards search direction
Definition at line 454 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by TreeMutatorBinding_test::mutateDummy(), EventLog_test::verify_backwardMatch(), EventLog_test::verify_callLogging(), EventLog_test::verify_eventLogging(), EventLog_test::verify_logJoining(), EventLog_test::verify_logPurging(), EventLog_test::verify_negatedMatch(), and EventLog_test::verify_regExpMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & afterMatch | ( | string | regExp | ) |
Definition at line 462 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog_test::verify_regExpMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & afterEvent | ( | string | match | ) |
Definition at line 470 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by ActivityMatch::afterSeqIncrement(), BusTerm_test::attachNewBusTerm(), AbstractTangible_test::markState(), AbstractTangible_test::revealer(), and LateBindInstance_test::verify_forwarding().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & afterEvent | ( | string | classifier, |
| string | match | ||
| ) |
Definition at line 478 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Here is the call graph for this function:| EventMatch & afterCall | ( | string | match | ) |
find a function invocation backwards, before the current point of reference
Definition at line 489 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by AbstractTangible_test::revealer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
refine filter to additionally require specific arguments
Definition at line 198 of file event-log.hpp.
References EventMatch::refineSerach_matchArguments().
Referenced by EventMatch::argPos(), BusTerm_test::attachNewBusTerm(), TestTracking_test::demonstrate_checkAllocator(), TestTracking_test::demonstrate_logObject(), AbstractTangible_test::markState(), BusTerm_test::pushDiff(), AbstractTangible_test::revealer(), EventLog_test::verify_callLogging(), EventLog_test::verify_eventLogging(), LateBindInstance_test::verify_forwarding(), EventLog_test::verify_genericLogging(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasBound(), Nexus::wasInvoked(), and Nexus::wasInvoked().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
refine filter to additionally cover all arguments with a series of regular expressions.
Definition at line 217 of file event-log.hpp.
References util::join(), and EventMatch::refineSerach_matchArgsRegExp().
Referenced by EventLog_test::verify_regExpMatch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
refine filter to additionally require match on a specific positional argument
Definition at line 227 of file event-log.hpp.
References EventMatch::arg(), EventMatch::refineSerach_matchArgument(), and util::toString().
Referenced by TestTracking_test::demonstrate_checkAllocator(), and EventLog_test::verify_callLogging().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & type | ( | string | typeID | ) |
refine filter to additionally require a matching log entry type
Definition at line 539 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog_test::verify_genericLogging(), EventLog_test::verify_logPurging(), MockElm::verifyMark(), MockElm::verifyMark(), and MockElm::verifyMark().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & key | ( | string | key | ) |
refine filter to additionally require the presence an attribute
Definition at line 550 of file event-log.cpp.
References EventMatch::evaluateQuery(), EventMatch::key(), and EventMatch::solution_.
Referenced by EventMatch::attrib(), and EventMatch::key().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & attrib | ( | string | key, |
| string | valueMatch | ||
| ) |
refine filter to additionally match on a specific attribute
Definition at line 561 of file event-log.cpp.
References EventMatch::evaluateQuery(), EventMatch::key(), and EventMatch::solution_.
Referenced by ActivityMatch::seq(), and EventLog_test::verify_genericLogging().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & id | ( | string | classifier | ) |
refine filter to additionally match on the ID attribute
Definition at line 572 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventLog_test::verify_eventLogging(), MockElm::verifyMark(), MockElm::verifyMark(), and MockElm::verifyMark().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & on | ( | string | targetID | ) |
refine filter to additionally match the ‘'this’` attribute
Definition at line 583 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by BusTerm_test::attachNewBusTerm(), TestTracking_test::demonstrate_checkAllocator(), TestTracking_test::demonstrate_logObject(), AbstractTangible_test::mutate(), EventMatch::on(), EventLog_test::verify_callLogging(), EventLog_test::verify_eventLogging(), EventLog_test::verify_logPurging(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasBound(), Nexus::wasInvoked(), and Nexus::wasInvoked().
Here is the call graph for this function:
Here is the caller graph for this function:| EventMatch & on | ( | CStr | targetID | ) |
Definition at line 591 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Here is the call graph for this function:
|
inline |
Definition at line 244 of file event-log.hpp.
References lib::idi::instanceTypeID(), and EventMatch::on().
Here is the call graph for this function:
|
private |
core of the evaluation machinery: apply a filter predicate and then pull through the log to find a acceptable entry
Definition at line 272 of file event-log.cpp.
References EventMatch::solution_.
Referenced by EventMatch::evaluateQuery().
Here is the caller graph for this function:
|
private |
this is actually called after each refinement of the filter and matching conditions.
The effect is to search for an (intermediary) solution right away and to mark failure as soon as some condition can not be satisfied. Rationale is to indicate the point where a chained match fails
| matchSpec | diagnostics description of the predicate just being added |
| rel | indication of the searching relation / direction |
Definition at line 288 of file event-log.cpp.
References EventMatch::foundSolution(), EventMatch::lastMatch_, EventMatch::look_for_match_, EventMatch::solution_, and EventMatch::violation_.
Referenced by EventMatch::after(), EventMatch::afterCall(), EventMatch::afterEvent(), EventMatch::afterEvent(), EventMatch::afterMatch(), EventMatch::attrib(), EventMatch::before(), EventMatch::beforeCall(), EventMatch::beforeEvent(), EventMatch::beforeEvent(), EventMatch::beforeMatch(), EventMatch::id(), EventMatch::key(), EventMatch::locate(), EventMatch::locateCall(), EventMatch::locateEvent(), EventMatch::locateEvent(), EventMatch::locateMatch(), EventMatch::on(), EventMatch::on(), EventMatch::refineSerach_matchArgsRegExp(), EventMatch::refineSerach_matchArgument(), EventMatch::refineSerach_matchArguments(), and EventMatch::type().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
refine filter condition additionally to match a specific positional call argument.
Definition at line 502 of file event-log.cpp.
References EventMatch::evaluateQuery(), EventMatch::solution_, and util::toString().
Referenced by EventMatch::argPos().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
refine filter condition additionally to match a sequence of call arguments.
Definition at line 512 of file event-log.cpp.
References EventMatch::evaluateQuery(), util::join(), and EventMatch::solution_.
Referenced by EventMatch::arg().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
refine filter condition additionally to cover call arguments by a sequence of regular expressions. Each regExp is used consecutively, until it fails to match; at that point, the next regExp is tried. When reaching the end of the argument sequence, we also expect to have used up all available regular expressions.
Definition at line 527 of file event-log.cpp.
References EventMatch::evaluateQuery(), and EventMatch::solution_.
Referenced by EventMatch::argMatch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
match predicate evaluator
Definition at line 129 of file event-log.hpp.
Referenced by EventMatch::after(), EventMatch::afterCall(), EventMatch::afterEvent(), EventMatch::afterEvent(), EventMatch::afterMatch(), EventMatch::attrib(), EventMatch::before(), EventMatch::beforeCall(), EventMatch::beforeEvent(), EventMatch::beforeEvent(), EventMatch::beforeMatch(), EventMatch::evaluateQuery(), EventMatch::foundSolution(), EventMatch::id(), EventMatch::key(), EventMatch::locate(), EventMatch::locateCall(), EventMatch::locateEvent(), EventMatch::locateEvent(), EventMatch::locateMatch(), EventMatch::on(), EventMatch::on(), EventMatch::refineSerach_matchArgsRegExp(), EventMatch::refineSerach_matchArgument(), EventMatch::refineSerach_matchArguments(), and EventMatch::type().
|
private |
record last match for diagnostics
Definition at line 132 of file event-log.hpp.
Referenced by EventMatch::evaluateQuery().
|
private |
support for positive and negative queries.
Definition at line 135 of file event-log.hpp.
Referenced by EventLog::ensureNot(), and EventMatch::evaluateQuery().
|
private |
record when the underlying query has failed
Definition at line 138 of file event-log.hpp.
Referenced by EventMatch::evaluateQuery(), and EventMatch::operator bool().
|
friend |
Definition at line 145 of file event-log.hpp.
Inheritance diagram for EventMatch:
Collaboration diagram for EventMatch: