My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 77: Suggestion: Terse Output Option
6 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 58
Owner:  ----
Closed:  Jun 05
Type-Enhancement
Priority-Low
OpSys-All


Sign in to add a comment
 
Reported by sbburners07, Dec 03, 2008
I would like a terse output option where only failures are reported.  The
standard format is seen as too verbose by some in my organization. I would
like a command line option to output in a more compact format, as some
other popular UT frameworks do.

This is simple enough for me to add to my local build of gtest, but it
would be great if I didn't have to -- it makes it easier to upgrade to new
releases of gtest if I can reduce (or eliminate) local modifications.


What is the expected output? 

say, "UnitTest.exe --gtest_output_format:terse" or "UnitTest.exe
--gtest_output_terse" would result in:

[==========] Running 151 tests from 1 test case.
[----------] 151 tests from Fixture
__FILE__(__LINE__): error: Expected: (0) != (var), actual: 0 vs 0
[  FAILED  ] Fixture.Test
[==========] 151 tests from 1 test case ran.
[  PASSED  ] 150 tests.
[  FAILED  ] 1 tests, listed below:
[  FAILED  ] Fixture.Test
 1 FAILED TESTS


Comment 1 by shiqian, Dec 15, 2008
This sounds fine.  We probably won't have time for this any time soon.  Would you 
like to give it a shot and share the result?  Please read the GoogleTestDevGuide wiki 
page for the necessary steps.  Thanks!
Status: Accepted
Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low OpSys-All
Comment 2 by sbburners07, Dec 16, 2008
Locally, I simply derive an object from PrettyUnitTestResultPrinter (also make its 
member protected instead of private), and simply:
- Override "OnGlobalSetUpStart", "OnTestStart" to do nothing.  
- Override "OnTestEnd", "OnTestCaseEnd", "OnGlobalTearDownStart" to produce the 
minimal output I require.  
- Leave the other methods implemented in "PrettyUnitTestResultPrinter."

I then install this "Terse" printer instead of the "Pretty" one in 
"UnitTestImpl::result_printer()".  I didn't support the command line switch, though, 
as the "Pretty" output is just too verbose for my organization's use.

If I can ever find the time, I may try polish it (i.e. make a command line switch) 
and go through the process of submitting.  This is a feature I have seen requested 
several times on the actual googletest Wiki pages, so I know it has some value.
Comment 3 by vladlosev, Jun 05, 2009
Since this issue deals with the same topic as  issue 58  I am merging them. Please
refer to the  issue 58  for further developments.
Status: Duplicate
Mergedinto: 58
Sign in to add a comment