googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Quiet output

Open GoogleCodeExporter opened this issue 11 years ago • 8 comments

There is no flag to pass to InitGoogleTest that results in minimal console 
output. Such a flag would tell gtest to only output errors from failed tests, 
the number of tests passed, and the total time elapsed. This flag is necessary 
if one wants to compile all tests into a executable to be run as a post-build 
step.

Original issue reported on code.google.com by [email protected] on 4 Mar 2011 at 8:41

GoogleCodeExporter avatar Jul 28 '15 15:07 GoogleCodeExporter

A couple of semi-standard solutions that have come out since this issue was first raised:

  • This gist contains a sample ConfigurableEventListener decorator that allows selectively enabling or disabling output types.
  • My Google Test Pretty Printer significantly shortens GTest's output.

joshkel avatar Mar 07 '17 03:03 joshkel

Still believe this feature should be available out of the box, because there are a lot of tests already written and to achieve the behavior you would need to add listener to all of them. Instead having commandline option --quite or something like that would save a lot of time.

metal4people-zz avatar Jan 23 '19 08:01 metal4people-zz

Thank you very much for this report. The best way to approach this would be to create a proper PR and submit it for consideration.

gennadiycivil avatar Jan 25 '19 17:01 gennadiycivil

No problem. You know I've found better way to reach my aim. I think most of people needs the same is to use: --gtest_repeat and --gtest_break_on_failure. For example: --gtest_repeat=100 --gtest_break_on_failure will run tests 100 times, but once something fails it stop tests execution. Very convenient. Thank you guys!

metal4people-zz avatar Jan 26 '19 13:01 metal4people-zz

Great to hear. I suggest submitting a patch to the documentation so others can benefit. Thanks G

On Sat, Jan 26, 2019, 08:21 metal4people <[email protected] wrote:

No problem. You know I've found better way to reach my aim. I think most of people needs the same is to use: --gtest_repeat and --gtest_break_on_failure. For example: --gtest_repeat=100 --gtest_break_on_failure will run tests 100 times, but once something fails it stop tests execution. Very convenient. Thank you guys!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/googletest/issues/358#issuecomment-457830593, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJSMhiK0aqRzo23sKzbO3RKmjE5yU-Uks5vHFY8gaJpZM4MVAWH .

gennadiycivil avatar Jan 28 '19 14:01 gennadiycivil

+1 for this being an out-of-the-box feature

moof2k avatar Nov 27 '19 19:11 moof2k