iveney / googletest

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

Suggestion: Terse Output Option #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by sbburner...@gmail.com on 4 Dec 2008 at 12:17

GoogleCodeExporter commented 9 years ago
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!

Original comment by shiq...@gmail.com on 16 Dec 2008 at 4:07

GoogleCodeExporter commented 9 years ago
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.

Original comment by sbburner...@gmail.com on 17 Dec 2008 at 1:04

GoogleCodeExporter commented 9 years ago
Since this issue deals with the same topic as issue 58 I am merging them. Please
refer to the issue 58 for further developments.

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