comipayan / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Support for custom ResultPrinter #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the only additional ResultPrinter is the XMLUnitTestResultPrinter.
It should be possible to add custom ResultPrinter via a global
setResultPrinter method. (like GlobalTestEnvironments are added).
The custom ResultPrinter should implement the UnitTestEventListenerInterface.

I attached a patch wich makes the UnitTestEventListenerInterface public and
adds methods to add a custom ResultPrinter. This could be used before
RUN_ALL_TESTS() like:
testing::SetGlobalResultPrinter(new MyTestResultPrinter);

Problem with this solution is that now only the custom ResultPrinter is
used but not multiple (with UnitTestEventsRepeater).

It would also be nice if some of the helper methods used in
PrettyUnitTestResultPrinter would be available in the public interface.

Original issue reported on code.google.com by housemaister on 30 Oct 2008 at 2:52

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by shiq...@gmail.com on 31 Oct 2008 at 6:42

GoogleCodeExporter commented 9 years ago
The user clarified:

date    Mon, Nov 3, 2008 at 2:10 AM
subject Re: [googletest] Feature request: custom ResultPrinter

Hi ,

Thanks Zhanyong for your response; I'm happy to hear that you plan to
open up the event listener.
I have to admit that I missed the GoogleTestDevGuide page, but anyway
now I think my patch is not enough, so I don't want to have it
reviewed.

The listener I have in mind would write the test results to several
files (sorted in a directory structure by testcase and test) also a
summary file would be written. These files would also be used within
tests for logging.
It is not so important for unit tests but as I plan to use the
framework also as test controller for component and even subsystem
tests it gets more important there.
I already have a implementation using cppunit; but I'm now thinking
about a switch to googletest.

Regards,
Stefan.

Original comment by shiq...@gmail.com on 4 Nov 2008 at 10:24

GoogleCodeExporter commented 9 years ago

Original comment by shiq...@gmail.com on 2 Dec 2008 at 5:01

GoogleCodeExporter commented 9 years ago
Some users want to check heap leak in every test.  Opening up the event listener
interface would allow them to do that by responding to "test start" and "test 
end"
events.  Therefore I'm bumping up the priority to high.

Original comment by zhanyong...@gmail.com on 12 Jan 2009 at 5:43

GoogleCodeExporter commented 9 years ago
Issue 77 has been merged into this issue.

Original comment by vladlosev on 5 Jun 2009 at 10:41

GoogleCodeExporter commented 9 years ago
For those who missed the announcement in the mailing list:

We have the design for the event listener interface out and open for comments. 
The
design document is available at 
http://docs.google.com/Doc?id=dhspb9bn_6gqdknqhp. If
you want some features that are not covered by it, please respond with comments 
to
the announcement at
http://groups.google.com/group/googletestframework/browse_thread/thread/d80823ac
c6c73d58.

Original comment by vladlosev on 5 Jun 2009 at 11:04

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 23 Sep 2009 at 10:32

GoogleCodeExporter commented 9 years ago
This is available in SVN in revision 320.

Original comment by vladlosev on 1 Oct 2009 at 10:38