Re: [Cppunit-devel] How to use clocker in my own project ?
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2002-04-23 13:35:22
|
Clocker was note designed for 'real life' project (just an example of weird stuff you can do with the TestListener). As you may have noticed, reported time are far from accurate (even using the supposed high precision timer of Nt 100 nanosecond, you don't get anything better that a 10ms resolution). Still you raise an interesting problem. I can think of two ways of doing what you want at the current time: - Clocker write a second XML file, it is later merged with the first one (using XSL or whatever) - Extending XmlOutputter in Clocker to write the Xml ouput with test time. What are you using test time for ? I don't really see any use to this (total test time yes, but individual...) You're right about the average test time bug: the time of the test case is counted twice: for the test and the suite... I'll fix that. Baptiste. ----- Original Message ----- From: "Philippe Lavoie" <phi...@ca...> To: <cpp...@li...> Sent: Tuesday, April 23, 2002 1:25 AM Subject: [Cppunit-devel] How to use clocker in my own project ? Hi guys, Now that I've managed to figure out how to do a proper copy from one place to the other :) I'm ready to incorporate cppunit results inside the build process (I'm using ant to do the builds). I'd prefer to have the xml output with the test duration times included. I want to have the default XML output from DllPluginTester to also have timing values. What is the best way to achieve this ? I think I might be missing some basic concepts on how I can mix and match the different listener and outputer. I'm pretty sure I should look at the ClockPlugIn for guidance. I did the following naive test hoping that some magic would occur DllPlugInTesterd_dll -x test.xml -c Mine.dll clockerplugind.dll . (0.050s) All Tests +--(0.050s) InputErrorTest | +--(0.050s) InputErrorTest.testNormalUsage Total elapsed time: (0.050s) , average test case time: (0.150s) OK (1) The command line output is indeed magic :) (although there is a bug in the average test case time). However, the XML output is as follows. <?xml version="1.0" encoding='' standalone='yes' ?> <TestRun> <FailedTests></FailedTests> <SuccessfulTests> <Test id="1"> <Name>InputErrorTest.testNormalUsage</Name> </Test> </SuccessfulTests> <Statistics> <Tests>1</Tests> <FailuresTotal>0</FailuresTotal> <Errors>0</Errors> <Failures>0</Failures> </Statistics> </TestRun> Please let me know if you know in which direction I should go to add a time attribute to the Test results. Thanks. Phil _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |