My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 58: Support for custom ResultPrinter
12 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Oct 01
Cc:  w...@google.com
Type-Enhancement
Priority-High
OpSys-All


Sign in to add a comment
 
Reported by housemaister, Oct 30, 2008
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.
googletest.patch
4.8 KB   Download
Comment 1 by shiqian, Oct 31, 2008
(No comment was entered for this change.)
Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low OpSys-All
Comment 2 by shiqian, Nov 04, 2008
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.
Labels: -Priority-Low Priority-Medium
Comment 3 by shiqian, Dec 01, 2008
(No comment was entered for this change.)
Status: Accepted
Comment 4 by zhanyong.wan, Jan 12, 2009
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.
Labels: -Priority-Medium Priority-High
Comment 5 by vladlosev, Jun 05, 2009
 Issue 77  has been merged into this issue.
Comment 6 by vladlosev, Jun 05, 2009
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/d80823acc6c73d58.
Cc: w...@google.com
Comment 7 by zhanyong.wan, Sep 23, 2009
(No comment was entered for this change.)
Status: Started
Comment 8 by vladlosev, Oct 01, 2009
This is available in SVN in revision 320.
Status: Fixed
Sign in to add a comment