![]() |
Lumiera 0.pre.04
»edit your freedom«
|
Implementation details of event logging and verification for unit tests. More...
Go to the source code of this file.
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.
Definition in file event-log.cpp.
Namespaces | |
| namespace | lib |
| Implementation namespace for support and library code. | |
| namespace | lib::test |
| Unit tests for the Lumiera support library. | |
| namespace | lib::test::anonymous_namespace{event-log.cpp} |
Typedefs | |
| using | Filter = decltype(buildSearchFilter(std::declval< Log const & >())) |
| using | ArgSeq = lib::diff::RecordSetup< string >::Storage |
| using | RExSeq = std::vector< std::regex > |
Enumerations | |
| enum | Direction { FORWARD , BACKWARD , CURRENT } |
Functions | |
| auto | find (string match) |
| auto | findRegExp (string regExpDef) |
| auto | findEvent (string match) |
| auto | findEvent (string classifier, string match) |
| auto | findCall (string match) |
| auto | matchArguments (ArgSeq &&argSeq) |
| this filter functor is for refinement of an existing filter | |
| auto | matchArgument (size_t idx, string match) |
| refinement filter to match a specific positional argument | |
| auto | matchArgsRegExp (RExSeq &®ExpSeq) |
| refinement filter, to cover all arguments by regular expression(s) | |
| auto | matchType (string typeID) |
| refinement filter to match on the given typeID | |
| auto | ensureAttribute (string key) |
| refinement filter to ensure a specific attribute is present on the log entry | |
| auto | matchAttribute (string key, string valueMatch) |
| refinement filter to ensure a specific attribute is present on the log entry | |
| template<typename COND > | |
| void | attachNextSerchStep (Filter &solution, COND &&searchCond, Direction direction) |
| template<typename COND > | |
| void | refineSerach (Filter &solution, COND &&additionalCond) |