Re: [Cppunit-devel] question about document generation
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2003-09-09 02:51:32
|
Create a singleton TestListener that collect the test description and = associates them to the test as they are run. Have it implements = XmlOutputterHook to add the test description to the XML output and = you're done. Then, in each test method, you need to call a method on your singleton = TestListener to set the test description. You could also also write a = new CPPUNIT_TEST macro that would take the description as a parameter = and wrap the 'setup' to set the test description. The first approach is easier to implement, but will not allow you to = associate the description to the test if setUp() fails, which the second = approach allow. Adding descriptive data to test is something I really want to do in = CppUnit V2. This includes, but is not limited to test description. When writing functional tests, it is often fairly useful to add some = other data to a test. Baptiste. PS: I'm also from Paris ;-) ----- Original Message -----=20 From: Gzo...@ao...=20 To: cpp...@li...=20 Cc: Pat...@fr...=20 Sent: Sunday, September 07, 2003 7:04 PM Subject: [Cppunit-devel] question about document generation hello ! First of all, i want to congratulate you for CppUnit which is a great = product ! I am using it everyday (work days and weekends ! ;-) and spread it out = as much as i can ... Now, comes my question : I work in a company where paper and documentation is important :-\ I'll have to produce a document with the result of the test execution = produced by CppUnit. So, my objective is to produce the "test document" automatically with = CppUnit. The idea is the following : - to be able to associate a documentation (objective of the test, kind = of requirement, ...) with every test - to be able to run the tests as usual, recording success, failures = and errors - to collect, for every test, the documentation and the result of the = test. The documentation could be a simple std::string associated with a = test. The formatting part of the document shouldn't be a problem either. So the tricky part is to to be able to insert the documentation in = CppUnit framework. How would you do that ? I don't see how to do that without modifying the core of CppUnit. Do you think there is a simpler way ? Thanks in advance for your answer ...=20 Cheers from Paris (France, not Texas !) Patrice |