28 #ifndef D_MemoryReporterPlugin_h 29 #define D_MemoryReporterPlugin_h 31 #include "CppUTest/TestPlugin.h" 32 #include "CppUTestExt/MemoryReportAllocator.h" 34 class MemoryReportFormatter;
36 class MemoryReporterPlugin :
public TestPlugin
38 MemoryReportFormatter* formatter_;
40 MemoryReportAllocator mallocAllocator;
41 MemoryReportAllocator newAllocator;
42 MemoryReportAllocator newArrayAllocator;
44 SimpleString currentTestGroup_;
46 MemoryReporterPlugin();
47 virtual ~MemoryReporterPlugin();
49 virtual void preTestAction(UtestShell & test, TestResult & result) _override;
50 virtual void postTestAction(UtestShell & test, TestResult & result) _override;
51 virtual bool parseArguments(
int,
const char**,
int) _override;
54 virtual MemoryReportFormatter* createMemoryFormatter(
const SimpleString& type);
57 void destroyMemoryFormatter(MemoryReportFormatter* formatter);
59 void setGlobalMemoryReportAllocators();
60 void removeGlobalMemoryReportAllocators();
62 void initializeAllocator(MemoryReportAllocator* allocator, TestResult & result);