File: DumperPlugIn.cpp

package info (click to toggle)
cppunit 1.15.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,768 kB
  • sloc: cpp: 12,701; sh: 4,280; ansic: 687; makefile: 401; xml: 58
file content (65 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <cppunit/TestResult.h>
#include <cppunit/plugin/TestPlugIn.h>
#include "DumperListener.h"



class DumperPlugIn : public CppUnitTestPlugIn
{
public:
  DumperPlugIn()
    : m_dumper( NULL )
  {
  }

  ~DumperPlugIn()
  {
    delete m_dumper;
  }


  void initialize( CPPUNIT_NS::TestFactoryRegistry *registry,
                   const CPPUNIT_NS::PlugInParameters &parameters )
  {
    bool flatten = false;
    if ( parameters.getCommandLine() == "flat" )
      flatten = true;

    m_dumper = new DumperListener( flatten );
  }


  void addListener( CPPUNIT_NS::TestResult *eventManager )
  {
    eventManager->addListener( m_dumper );
  }


  void removeListener( CPPUNIT_NS::TestResult *eventManager )
  {
    eventManager->removeListener( m_dumper );
  }


  void addXmlOutputterHooks( CPPUNIT_NS::XmlOutputter *outputter )
  {
  }


  void removeXmlOutputterHooks()
  {
  }


  void uninitialize( CPPUNIT_NS::TestFactoryRegistry *registry )
  {
  }

private:
  DumperListener *m_dumper;
};


CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL( DumperPlugIn );

CPPUNIT_PLUGIN_IMPLEMENT_MAIN();