Re: [Cppunit-devel] output fix
Brought to you by:
blep
From: Baptiste L. <bl...@cl...> - 2001-05-30 18:26:12
|
> On Wed, May 23, 2001 at 05:06:45PM -0400, Steve M. Robbins wrote: > Myself, I prefer the previous verbose style that printed the test > names as they were executed. To that end, I have derived a new class > from TestResult. If you wish to include this as an example or > whatever, be my guest. Have you found a way to specify which TestResult the TestRunner should use ? > > Obviously different people want different output. For a nice clean > cutomizable output mechanism it may be worthwhile to look at JUnits' > approach with the TestListener interface. That way we need only one > TestResult class and no derived classes. People can simply add the Listeners > they want to the TestResult. Yes, that's probably the best. If your doing a GUI you more or less end up rewriting that to enable incremental report anyway... > P.S. Incidentally, I discovered that simple functions, like > "TestResult::runTests()" that returns the number of tests run, are not > declared "const". Is that an oversight, or does it have something to > do with the synchronization baggage that TestResult carries? Not really. Somewhere on wiki Michael Feather's said that having no const method makes refactoring C++ easier (not his exact wording. It was on the C++ XP challenge discussion I think). So Michael Feather's version does not have any const methods. Constness have been added on sourceforge version and there might be some missing... > Well, the synchronization object makes it difficult to make the methods > const. I guess it should be possible if the synchronization object were > declared 'mutable const', but I don't think 'mutable' is properly supported > on all (most?) platforms yet. It works ok on VC++, but I guess there might be some problem on other platforms... Though I'd really like to know which. It impossible to write a multithreaded programm without having to make locks mutable when you use const method, and I don't really like using macro for that... |