RE: [Cppunit-devel] How to use clocker in my own project ?
Brought to you by:
blep
From: Philippe L. <phi...@ca...> - 2002-04-23 14:08:14
|
I want to use the timing for statistics. Often developpers will do a = small change that has a big impact on performance, they added expensive = copy-constructors or other such nuisance. I just want to keep track of the overall progress of the timings. I'm = using cppunit as part of an integrated build process based on ant. At = every hours or so, the build process finds out if there is something = new. It then compiles and runs the tests. A new result-YYYYMMDDHHMM.xml = file is created.=20 The build process then merges the information with the other = result-XXXXX files. A graph of the timings can be made, and other = statistical information too (number of line of codes changed, number of = tests added, etc.).=20 Whether this is really important, I don't know. I just know that we = shouldn't be making things slower as we progress and that catching this = as part of the build process is as a good place as any other :) Phil PS This comes from one of our clients where the test stress every bugfix = to see if a fix comes with a speed degradation cost.=20 > -----Original Message----- > From: Baptiste Lepilleur [mailto:gai...@fr...] > Sent: Tuesday, April 23, 2002 9:42 AM > To: cpp...@li... > Subject: Re: [Cppunit-devel] How to use clocker in my own project ? >=20 >=20 > Clocker was note designed for 'real life' project (just an=20 > example of weird > stuff you can do with the TestListener). As you may have=20 > noticed, reported > time are far from accurate (even using the supposed high=20 > precision timer of > Nt 100 nanosecond, you don't get anything better that a 10ms=20 > resolution). >=20 > Still you raise an interesting problem. I can think of two=20 > ways of doing > what you want at the current time: > - Clocker write a second XML file, it is later merged with=20 > the first one > (using XSL or whatever) > - Extending XmlOutputter in Clocker to write the Xml ouput=20 > with test time. >=20 > What are you using test time for ? I don't really see any use=20 > to this (total > test time yes, but individual...) >=20 > You're right about the average test time bug: the time of the=20 > test case is > counted twice: for the test and the suite... I'll fix that. >=20 > Baptiste. >=20 > ----- 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 ? >=20 >=20 >=20 > Hi guys, >=20 > Now that I've managed to figure out how to do a proper copy=20 > from one place > to the other :) I'm ready to incorporate cppunit results=20 > inside the build > process (I'm using ant to do the builds). >=20 > I'd prefer to have the xml output with the test duration=20 > times included. I > want to have the default XML output from DllPluginTester to=20 > also have timing > values. What is the best way to achieve this ? >=20 > I think I might be missing some basic concepts on how I can=20 > mix and match > the different listener and outputer. I'm pretty sure I should=20 > look at the > ClockPlugIn for guidance. >=20 > I did the following naive test hoping that some magic would occur >=20 > DllPlugInTesterd_dll -x test.xml -c Mine.dll clockerplugind.dll > . > (0.050s) All Tests > +--(0.050s) InputErrorTest > | +--(0.050s) InputErrorTest.testNormalUsage >=20 > Total elapsed time: (0.050s) , average test case time: (0.150s) OK (1) >=20 > The command line output is indeed magic :) (although there is=20 > a bug in the > average test case time). However, the XML output is as follows. >=20 >=20 > <?xml version=3D"1.0" encoding=3D'' standalone=3D'yes' ?> > <TestRun> > <FailedTests></FailedTests> > <SuccessfulTests> > <Test id=3D"1"> > <Name>InputErrorTest.testNormalUsage</Name> > </Test> > </SuccessfulTests> > <Statistics> > <Tests>1</Tests> > <FailuresTotal>0</FailuresTotal> > <Errors>0</Errors> > <Failures>0</Failures> > </Statistics> > </TestRun> >=20 > Please let me know if you know in which direction I should go=20 > to add a time > attribute to the Test results. Thanks. >=20 >=20 > Phil >=20 >=20 > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppunit-devel >=20 >=20 >=20 > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppunit-devel >=20 |