Header-only library - API adapter for Playback-Based Testing
Steps to integrate CppPlayer:
- Derive your operational base class from IOperational.
- Insert following static method into that base class declaration.
static inline CallMap& libraryCallMap()
{
static CallMap yourCallmap;
return yourCallmap;
}
- To wrap each of your business objects, derive a class from your operational base class.
- Derive your main business object from IMain.
- Instrument your business object wrappers.
The framework requires that wrapper objects instantiate using std::shared_ptr
Instrumentation:
- From each instrumented API, invoke recordFunction at the end.
- (Or recordMethod if function returns void).
- Declare and implement a playback method.
Samples
IHFDM sample (does not compile)