Fw: [Cppunit-devel] Custom progress with TextTestRunner
Brought to you by:
blep
|
From: Baptiste L. <gai...@fr...> - 2002-04-02 12:35:32
|
----- Original Message ----- From: "Baptiste Lepilleur" <gai...@fr...> Cc: <cpp...@li...> Sent: Thursday, March 28, 2002 9:51 PM Subject: Re: [Cppunit-devel] Custom progress with TextTestRunner > ----- Original Message ----- > From: "Robert Wenner" <ro...@po...> > To: "Baptiste Lepilleur" <gai...@fr...> > Cc: <cpp...@li...> > Sent: Thursday, March 28, 2002 11:25 AM > Subject: Re: [Cppunit-devel] Custom progress with TextTestRunner > > > > On Wed, Mar 27, 2002 at 05:41:54PM +0100, Baptiste Lepilleur wrote: > > > > > Hum, actually you can already do that (forgot that I exposed the > > > eventManager to do that): > > > CppUnit::TextTestRunner runner; > > > runner.addTest( CppUnitTest::suite() ); // Add the top suite to the > test > > > runner > > > runner.eventManager().addListener( &myProgress ); // your > progress > > > indicator > > > > > > runner.run(...) > > > > > > => the TextTestProgressListener would still be used, but called your > > > listener (since it was registered first). I'll just add an option to > make it > > > optional. > > > > > In version 1.7.10 another flag (yuk) has been added to the run method to > specify you don't want the default TextTestProgressListener. > > > > > Unfortunately this does not work as expected. > > Adding my own listener as described above results in mixed output from > > my listener and TextTestProgressListener as in > > bool CppUnit::TextTestRunner::runTest(Test *test) with each call to > > this method a new TextTestProgressListener is created, added to the > > list of listeners and after the test removed. :-( > > No way to avoid this without modifying the source. > > > > Why is it done this way? Isn't that a somewhat tight coupling between > > the TestRunner and one of its Listeners? Isn't TextTestRunner > > actually a misnomer? IMHO there should be exactly one kind of > > TestRunner but it would be independent of Text, GUI or > > whatever and its Listeners and ResultCollectors would take care of > > displaying and such. > > History. Not so long ago, you couldn't parameterize anything. This will > probably change in the > future... > > Baptiste. > > > > > > > Robert > > > |