diff options
Diffstat (limited to 'examples/ClockerPlugIn/ClockerPlugIn.cpp')
| -rw-r--r-- | examples/ClockerPlugIn/ClockerPlugIn.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/examples/ClockerPlugIn/ClockerPlugIn.cpp b/examples/ClockerPlugIn/ClockerPlugIn.cpp index 8943629..dbdd672 100644 --- a/examples/ClockerPlugIn/ClockerPlugIn.cpp +++ b/examples/ClockerPlugIn/ClockerPlugIn.cpp @@ -1,6 +1,9 @@ #include <cppunit/TestResult.h> +#include <cppunit/XmlOutputter.h> #include <cppunit/plugin/TestPlugIn.h> +#include "ClockerXmlHook.h" #include "ClockerListener.h" +#include "ClockerModel.h" @@ -9,23 +12,29 @@ class ClockerPlugIn : public CppUnitTestPlugIn public: ClockerPlugIn() : m_dumper( NULL ) + , m_model( NULL ) + , m_xmlHook( NULL ) { } ~ClockerPlugIn() { delete m_dumper; + delete m_model; + delete m_xmlHook; } void initialize( CppUnit::TestFactoryRegistry *registry, const CppUnit::Parameters ¶meters ) { - bool flatten = false; - if ( parameters.size() > 0 && parameters[0] == "flat" ) - flatten = true; + bool text = false; + if ( parameters.size() > 0 && parameters[0] == "text" ) + text = true; - m_dumper = new ClockerListener( flatten ); + m_model = new ClockerModel(); + m_dumper = new ClockerListener( m_model, text ); + m_xmlHook = new ClockerXmlHook( m_model ); } @@ -41,12 +50,25 @@ public: } + void addXmlOutputterHooks( CppUnit::XmlOutputter *outputter ) + { + outputter->addHook( m_xmlHook ); + } + + + void removeXmlOutputterHooks() + { + } + + void uninitialize( CppUnit::TestFactoryRegistry *registry ) { } private: ClockerListener *m_dumper; + ClockerModel *m_model; + ClockerXmlHook *m_xmlHook; }; |
