summaryrefslogtreecommitdiff
path: root/examples/ClockerPlugIn/ClockerPlugIn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ClockerPlugIn/ClockerPlugIn.cpp')
-rw-r--r--examples/ClockerPlugIn/ClockerPlugIn.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/examples/ClockerPlugIn/ClockerPlugIn.cpp b/examples/ClockerPlugIn/ClockerPlugIn.cpp
new file mode 100644
index 0000000..8943629
--- /dev/null
+++ b/examples/ClockerPlugIn/ClockerPlugIn.cpp
@@ -0,0 +1,55 @@
+#include <cppunit/TestResult.h>
+#include <cppunit/plugin/TestPlugIn.h>
+#include "ClockerListener.h"
+
+
+
+class ClockerPlugIn : public CppUnitTestPlugIn
+{
+public:
+ ClockerPlugIn()
+ : m_dumper( NULL )
+ {
+ }
+
+ ~ClockerPlugIn()
+ {
+ delete m_dumper;
+ }
+
+
+ void initialize( CppUnit::TestFactoryRegistry *registry,
+ const CppUnit::Parameters &parameters )
+ {
+ bool flatten = false;
+ if ( parameters.size() > 0 && parameters[0] == "flat" )
+ flatten = true;
+
+ m_dumper = new ClockerListener( flatten );
+ }
+
+
+ void addListener( CppUnit::TestResult *eventManager )
+ {
+ eventManager->addListener( m_dumper );
+ }
+
+
+ void removeListener( CppUnit::TestResult *eventManager )
+ {
+ eventManager->removeListener( m_dumper );
+ }
+
+
+ void uninitialize( CppUnit::TestFactoryRegistry *registry )
+ {
+ }
+
+private:
+ ClockerListener *m_dumper;
+};
+
+
+CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL( ClockerPlugIn );
+
+CPPUNIT_TESTPLUGIN_MAIN(); \ No newline at end of file