Re: [Cppunit-devel] hierarchy sample bug...
Brought to you by:
blep
From: Baptiste L. <bl...@cl...> - 2001-05-12 15:45:43
|
> FWIW, I agree with the following solution. FWIW <= what does it stand for ? > > >> To do cppunit: > >> - remove TestRegistry.cpp/.h > >> - implement a TextTestRunner > >> > >> To do for the sample: > >> - add a suite() method for each test case, which returns a > >> dynamically allocated suite, > >> - add the suite of each test case to the TextTestRunner, > >> - run the TextTestRunner. > >> => this would make it similar to run suite using a graphic or text > >> TestRunner, and would show how test case should be factored. > > As a cppunit newbie, this would make a lot of sense to me. There are so > many options that it's a little overwhelming. I also don't want to > restructure all my test code when the next release comes out. The proposed > solution would allow both automated text based tests and interactive tests, > from essentially the same code. This would be best accomplished if there > were slight changes to make TestRunner have a pure virtual run() method and > then have a TextTestRunner and a GuiTestRunner. The GuiTestRunners could > changed slightly for different platforms. Having a comon base class is not really required, only having the same ownership and usage policy is required. Usualy the test runner you will use depend on the available test runner on your environnement (for a console application, you must use a text based test runner for example). The thing that matter is that you don't have to rewrite you test or suite because you need to change the test runner you are using. > > I realize I'm late to the discussion and perhaps I don't understand all the > issues. I see that there has so far been no effort to create a GUI > TestRunner for other platforms. (although I am extremely grateful that it > has been done for Windows, where I'm currently developing!!) Seems like at > least the base TestRunner class would end up in cppunit, with only the > platform specific parts in directories under src and in parallel with > cppunit and msvc6. The discussion was mainly about the use of the new TestCaller constructor which take a reference to a TestCase and the issue with the test case ownership (See explanation in previous mail). I realized that Baastian did not have this problem because in the sample, tests and suites were instantiated as automatic variable. > > Thanks for getting the Win32 support out! I was doing many of the same fixes > to get in synch with the SoureForge version, but at least compile with MSVC. > Getting it all merged in was a real bonus! Saved me a lot of time. > > > I'm not sure how much time I can spare, but I am hoping that I can > contribute to some degree, including documentation. As usual, the docs are You're welcome ! > secondary to getting working code (and getting the design bugs worked out). > I find myself jumping around a lot of different documents and geting > confused about all the new features that aren't really documented. Luckily I Could you draw a list of the "missing" documentations, and the other part you find difficult to get started. This would make our "To do" list for documenation. For the new functionnalities, you can found something akin to a "getting started" at http://gaiacrtn.free.fr/cppunit/index.html but is it somewhat short. Another problem is that g++ does not provides usable typeinfo name which make life much easier (the suite is automatically named when using the TestSuiteBuilder). So with g++ you would need to specify the suite name to TestSuiteBuilder while on Windows you can get away using typeinfo... Humm, thinking of it, introducing the generic way, then the typeinfo way would work... Also some documenation about writing test might be interesting (whitebox testing against blackbox testing), self-shunt test pattern... > can still use the basic classes and get useful work done. I've done a lot of > documentation in the past, including full databook writing and editing; and > actually don't mind it at all. (however I still have work deadlines to meet > first...) It's not clear to me however if it is worth updating the cookbook > until the next round of stuff with TestRunner is straightened up... The TextTestRunner need to be cleaned up. It prints and assumes way to much things. > > Hope this is not too much in one message, but I also suggest the suite() > method be added to either Test or TestCase. I have been seeing a lot of > discussion about this method, including in the CppUnit Cookbook document, This can't be done since suite() is a static method ! > and it's confusing for it not to be a virtual method in one of the base > classes. It would also provide a good place to add some documentation for > its use. Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |