Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/test/event-log.hpp"
ongoing evaluation and match within an [EventLog].
Definition at line 129 of file event-log.hpp.
Public Member Functions | |
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 & | afterCall (string match) |
find a function invocation backwards, before the current point of reference | |
EventMatch & | afterEvent (string match) |
EventMatch & | afterEvent (string classifier, string match) |
EventMatch & | afterMatch (string regExp) |
template<typename... ARGS> | |
EventMatch & | arg (ARGS const &...args) |
refine filter to additionally require specific arguments More... | |
template<typename... ARGS> | |
EventMatch & | argMatch (ARGS const &...regExps) |
refine filter to additionally cover all arguments with a series of regular expressions. More... | |
template<typename ARG > | |
EventMatch & | argPos (size_t idx, ARG const &arg) |
refine filter to additionally require match on a specific positional argument | |
EventMatch & | attrib (string key, string valueMatch) |
refine filter to additionally match on a specific attribute | |
EventMatch & | before (string match) |
find a match (substring match) of the given text in an EventLog entry after the current position More... | |
EventMatch & | beforeCall (string match) |
find a match for some function invocation after the current point of reference More... | |
EventMatch & | beforeEvent (string match) |
find a match for an "event" after the current point of reference More... | |
EventMatch & | beforeEvent (string classifier, string match) |
EventMatch & | beforeMatch (string regExp) |
find a match with the given regular expression | |
EventMatch & | id (string classifier) |
refine filter to additionally match on the ID attribute | |
EventMatch & | key (string key) |
refine filter to additionally require the presence an attribute | |
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. More... | |
EventMatch & | locateCall (string match) |
basic search for some specific function invocation More... | |
EventMatch & | locateEvent (string match) |
basic search for a matching "event" More... | |
EventMatch & | locateEvent (string classifier, string match) |
EventMatch & | locateMatch (string regExp) |
basic search like locate() but with the given regular expression | |
EventMatch & | on (string targetID) |
refine filter to additionally match the 'this' attribute | |
EventMatch & | on (const char *targetID) |
template<typename X > | |
EventMatch & | on (const X *const targetObj) |
operator bool () const | |
final evaluation of the match query, usually triggered from the unit test CHECK() . More... | |
EventMatch & | type (string typeID) |
refine filter to additionally require a matching log entry type | |
Friends | |
class | EventLog |
Private Types | |
using | ArgSeq = lib::diff::RecordSetup< string >::Storage |
using | Filter = decltype(buildSearchFilter(std::declval< Log const & >())) |
using | RExSeq = std::vector< std::regex > |
Private Member Functions | |
EventMatch (Log const &srcSeq) | |
void | evaluateQuery (string matchSpec, Literal rel="after") |
this is actually called after each refinement of the filter and matching conditions. More... | |
bool | foundSolution () |
core of the evaluation machinery: apply a filter predicate and then pull through the log to find a acceptable entry | |
void | refineSerach_matchArgsRegExp (RExSeq &®ExpSeq, string rendered_regExps) |
void | refineSerach_matchArgument (size_t idx, string match) |
void | refineSerach_matchArguments (ArgSeq &&argSeq) |
Private Attributes | |
string | lastMatch_ |
record last match for diagnostics | |
bool | look_for_match_ |
support for positive and negative queries. More... | |
Filter | solution_ |
match predicate evaluator | |
string | violation_ |
record when the underlying query has failed | |
|
private |
for creating EventLog matchers
Definition at line 267 of file event-log.cpp.
|
inline |
final evaluation of the match query, usually triggered from the unit test CHECK()
.
Definition at line 162 of file event-log.hpp.
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 330 of file event-log.cpp.
Referenced by EventLog::ensureNot(), and EventLog::verify().
EventMatch & locateEvent | ( | string | match | ) |
basic search for a matching "event"
match | perform a substring match against the arguments of the event |
Definition at line 354 of file event-log.cpp.
Referenced by EventLog::verifyEvent().
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 374 of file event-log.cpp.
Referenced by EventLog::verifyCall().
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 393 of file event-log.cpp.
Referenced by EventLog_test::verify_logJoining(), and AbstractTangible_test::verify_mockManipulation().
EventMatch & beforeEvent | ( | string | match | ) |
find a match for an "event" after the current point of reference
event
error
create
destroy
logJoin
match | perform a substring match against the arguments of the event |
Definition at line 426 of file event-log.cpp.
Referenced by BusTerm_test::attachNewBusTerm(), ActivityMatch::beforeSeqIncrement(), AbstractTangible_test::markState(), AbstractTangible_test::revealer(), EventLog_test::verify_logJoining(), and Nexus::wasInvoked().
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 447 of file event-log.cpp.
Referenced by BusTerm_test::attachNewBusTerm(), AbstractTangible_test::markState(), AbstractTangible_test::revealer(), EventLog_test::verify_logJoining(), Nexus::wasBound(), and Nexus::wasInvoked().
|
inline |
refine filter to additionally require specific arguments
Definition at line 207 of file event-log.hpp.
References EventMatch::refineSerach_matchArguments().
Referenced by BusTerm_test::attachNewBusTerm(), AbstractTangible_test::markState(), AbstractTangible_test::revealer(), EventLog_test::verify_logJoining(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasBound(), and Nexus::wasInvoked().
|
inline |
refine filter to additionally cover all arguments with a series of regular expressions.
Definition at line 226 of file event-log.hpp.
References EventMatch::refineSerach_matchArgsRegExp().
Referenced by EventLog_test::verify_logJoining().
|
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 297 of file event-log.cpp.
References EventMatch::look_for_match_.
Referenced by EventMatch::argPos().
|
private |
refine filter condition additionally to match a specific positional call argument.
Definition at line 511 of file event-log.cpp.
Referenced by EventMatch::argPos().
|
private |
refine filter condition additionally to match a sequence of call arguments.
Definition at line 521 of file event-log.cpp.
Referenced by EventMatch::arg(), and EventMatch::argPos().
|
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 536 of file event-log.cpp.
Referenced by EventMatch::argMatch(), and EventMatch::argPos().
|
private |
support for positive and negative queries.
Definition at line 144 of file event-log.hpp.
Referenced by EventLog::ensureNot(), and EventMatch::evaluateQuery().