Lumiera  0.pre.03
»edit your freedom«
event-log.cpp File Reference

Go to the source code of this file.

Description

Implementation details of event logging and verification for unit tests.

The EventLog is a helper for writing tests or for special rigging within the test or debugging or mock variant of some common services. It allows to log some events to memory and then to build match expressions to verify those captured information.

The machinery for matching on the occurrence of some events can be quite intricate at implementation level; we use an implementation based on a filtering iterator pipeline. This kind of code is template heavy and can cause a significant increase of generated code size – especially on debug builds. For that reason, we prefer to call through regular (non-inline) functions and package all the actual implementation code into this dedicated translation unit.

See also
EventLog_test
IterChainSearch_test
iter-explorer.hpp

Definition in file event-log.cpp.

#include "lib/error.hpp"
#include "lib/test/event-log.hpp"

Typedefs

using ArgSeq = lib::diff::RecordSetup< string >::Storage
 
using Filter = decltype(buildSearchFilter(std::declval< Log const & >()))
 
using RExSeq = std::vector< std::regex >
 

Enumerations

enum  Direction {
  FORWARD,
  BACKWARD,
  CURRENT
}
 

Functions

template<typename COND >
void attachNextSerchStep (Filter &solution, COND &&searchCond, Direction direction)
 
auto ensureAttribute (string key)
 refinement filter to ensure a specific attribute is present on the log entry
 
auto find (string match)
 
auto findCall (string match)
 
auto findEvent (string match)
 
auto findEvent (string classifier, string match)
 
auto findRegExp (string regExpDef)
 
auto matchArgsRegExp (RExSeq &&regExpSeq)
 refinement filter, to cover all arguments by regular expression(s) More...
 
auto matchArgument (size_t idx, string match)
 refinement filter to match a specific positional argument
 
auto matchArguments (ArgSeq &&argSeq)
 this filter functor is for refinement of an existing filter More...
 
auto matchAttribute (string key, string valueMatch)
 refinement filter to ensure a specific attribute is present on the log entry
 
auto matchType (string typeID)
 refinement filter to match on the given typeID
 
template<typename COND >
void refineSerach (Filter &solution, COND &&additionalCond)
 

Namespaces

 lib
 Implementation namespace for support and library code.