Anonymous - 2004-09-08

Hi all,

I use the TestPlugInRunner for running my tests in a DLL.
I like to add a listener to the TestResult. I think I did all necessary steps, but the virtual method addListener in my derived class of CpUnittestPlugIn is not called.

The listener I derived from TestListener:
    class MyTestFailureTracker : public CPPUNIT_NS::TestListener {...};

My plugin class

    class MyTestPluginImpl: public CppUnitTestPlugIn
    {
        ...
        MyTestFailureTracker* m_pMyTestFailureTracker;
    };

contains a pointer to my listener which is instantiated in the initialize method

    void MyTestPluginImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *registry,
                                   const CPPUNIT_NS::PlugInParameters &parameters )
    {
        m_pXTestFailureTracker = new XTestFailureTracker;
    }

I expected it to be ergistered at the TestResult which is hold by the PlugInRunner through implementing this virtual method:

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

But this method isn't called by the PlugInRunner. Anybody knows why?
How can I register my listener at the PlugInRunner (or the PlugInRunner's TestResult) ?

-Alfred