Re: [Cppunit-devel] TODO Documentation
Brought to you by:
blep
From: Robert W. <ro...@po...> - 2002-03-27 15:03:11
|
On Wed, Mar 27, 2002 at 03:25:07PM +0100, Baptiste Lepilleur wrote: > Can you look at http://gaiacrtn.free.fr/cppunit/index.html and let me know > if you find the GUI and the creatin test case/ways of macros description > clear enough ? (they need update but the basic haven't changed since then). I remember I had a look at that page, but quickly turned away because its release number was smaller than that I got (1.5.5 compared to 1.6.2) and it seemed to contain almost only MS Win stuff. > > In the cookbook I would put > > - how to create simple test cases (with CppUnit namespace) > > - test case using only CPPUINT_ASSERT > > - test case using CPPUNIT_ASSERT_EQUAL > > - advanced assertions with the CPPUNIT_ASSERT_MESSAGE > > - creating custom assertions using Asserter. (or should I put this at the > end ?) Depends on whether this is a newbie question or not. If it is easy to see why one would create custom assertions I would place it here. Otherwise at the end. > > - Helper Macros for convenience Or mention the Builder template here, too. > > - Creating a suite > > - Composing a suite from more suits (i.e. compose tests for n modules to > > form a big test for the whole program) > > - customizing output using an user defined TestListener > > - how to write the TestListener (subclass of TestListener) > > - how to hook it in > > - how to use the GUI > > - MSVC++ special stuff > > - other custmization stuff I haven't understood yet > > That layout looks good to me. You I keep the current cookbook, or scrap some > of it (subclassing TestCase for example ?) The current cookbook is ok, but not enough. :-) > >From what I read below, it's seems that you are indeed refering to > TestResultCollector (TestResult have been splitted in two classes since > 1.7.3). I have problems seeing where to get my own hooks in. For example: I got some test that may crash the program (segmentation fault). Thus the TextTestRunner displaying only dots and F or E does not suffice, I want the name of each test before it is started and the ok or e or f and the failure information when it finishes. With that I would see which test crashes the program (I don't want to rely on counting the dots and counting the test methods.) Now I wrote my own TestListener, but can not find where to get it in. TestCase does not define defaultResult to be virtual so I can not override it to return a TestResult to which I added my Listener. Also confusing: TextTestRunner and the UI Test Runners don't inherit from TestRunner? > I'm thinking of renaming TestResult to TestController. It's managing the > TestListener, and in the short future, it'll provide a way to > protected/decorate and test (for timing, COM initialization, and specific > exception capture). Would that help ? That is one thing, but more important would be IMHO some 3 to 5 sentences in a brief description what the class is used for. And a hint on what to customize here. This brief description should not copy the information already given in the generated documentation. For TestListener it could be something like this: "Implementing the Observer pattern a TestListener may be registered to a TestResult to obtain information on the testing progress. Use specialized sub classes of TestListener for text output (TextTestProgressListener). Do not use the Listener for the test result output, use a subclass of Outputter instead." Or for the TestResult: "Traverses the test cases in given suits. This class shouldn't have to be inherited from. Use a TestListener or one of its subclasses to be informed of the ongoing tests. Use a Outputter to receive a test summary once it has finished." [Correct me if I wrong, but you get the idea.] > There is a CPPUNIT_FAIL, name CPPUNIT_FAIL (amasing, isn't it ?) ;-) Ah, thanks, I really missed that one. :-) Maybe move the descriptions from the NEWS file to the official documentation, after removing references to the previous release of cppunit? Regards Robert |