Re: [Cppunit-devel] Test result output (was: news features...)
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2001-10-05 15:27:01
|
Quoting Volker Boerchers <vbo...@te...>: > On Fri, 5 Oct 2001, Baptiste Lepilleur wrote: > [...] > I wanted the following features: > - for every test method the name of the test was printed to STDOUT > either "passed", "failed" or "error". > - after execution of every single Test: print the name of the test > method and the execution time for the test to STDERR. > (That way we could mis-use the Unittests for performance checks) > - after each suite print either "--- suite: failed ---" or > "--- suite: success ---" goes to STDOUT. > - a more detailed summary of the suite is printed to STDERR. Easier, but not everything can be done. Some stuff I have in my head is to split in two: - a TextTestListener which report progress with the dot. - a TextTestResultOutputter which output the test result (list failure details). In your case, you might as well go ahead and write your one VerboseTextTestListener which output test name and status. You can compute the test execution time by intercepting startTest() and endTest() in the TestListener. For suite status report, not much help. There still isn't anything called when a suite is started/finished. Might be added in the future, though it would probably be a different Listener (TestSuiteListener ?). For the detailed log, you subclassing TextTestResultOutputter to get what you want. > That way it was easy to get both, a compact log e.g. for a daily > build, > and a verbose log (first on STDOUT, the latter on STDERR). > > Additionally every failure and error is printed in the same format that > is > used by g++. When i run the compile like that > > make && ./MyClassTest > > from my IDE (emacs) I can use the editor's parser to get to the > location of test-errors using 'next-error'. Now, there is a funny thing. No later than this morning, I was thinking that I could add a "post build step" that would do myapp -selftest, and exits after running the test and reporting the error in VC++ format (slighty different from g++). The format I had in my head was (sketch): file (line) : test name (failure type) (multiline-)message Statistics That would be another Outputter (CompilerTestResultOutputter (base class), GccTestResultOutputter and MsvcTestResultOutputter ?) > And - an essential for batch processing - the TextTestRunner returned > an > exit code that was translated in an exit code of the program signaling > error or success. How about wasSucess() ? > I hope it will be easier to implement such a thing after your changes. Easier, but there still works to be done. The heavy refactoring done on TextTestResult makes it easier to customize a particular part, but further refactoring it still needed to reach Nirvana. > > Somebody on the Unix side should check that everything build > correctly. 115 > > Unit tests should be running. Are all the 115 unit tests running (e.g. did I forgot to add a file in the MakeFile ?) > > There is a problem with missing itoa() (not only) on Linux, gcc > version > 2.95.2. I have attached a fix. Thanks, I'll include that this evening. The baka I am completly forgot to check if itoa was ANSI (aren't an ANSI equivalent anyway ?) Baptiste. > > Regards, > Volker > -- > Volker Boerchers <vbo...@te...> > System Engineer > TECON Systems AG, Perlengraben 2, 50676 Köln, http://www.tecon.de > Tel: +49-221-92007-55, Fax: +49-221-92007-77 > --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Language: English, French |