-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add GTEST_QUIET option #2751
Add GTEST_QUIET option #2751
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are open to this change, but have a couple of suggestions.
First, the name "quiet" seems to suggest that Google Test won't emit any output (reporting results by exit code only.) Maybe a different word is more appropriate, perhaps "brief"?
Second, adding a bunch of early exits to PrettyUnitTestResultPrinter feels slightly off. We think it could work out cleaner to have a second implementation of TestEventListener
for brief output, and install the appropriate listener based on the flag setting.
googletest/docs/advanced.md
Outdated
#### Suppressing test passes | ||
|
||
By default, googletest prints 1 line of output for each test, indicating if it | ||
passed or failed. T to show only test failures, run the test program with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"T to show" appears to be a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed in the last push.
Only prints failures and a total pass count
You were totally right about adding another TestEventListener - it's much cleaner this way. There is some code duplication though, I can understand if you want me to clean that up. I went a little further and removed the PrintFailedTests calls too, they are just duplicating the information printed from OnTestEnd. |
ctest has option https://cmake.org/cmake/help/latest/manual/ctest.1.html#options |
Only prints failures and a total pass count. This is useful for CI logs, which are more useful if they just have the failures instead of 100s or 1000s of lines of "PASSED" and the one failure buried in the middle.
Fixes #358, which was closed but seems to have a few fans...