Open ftrofin opened 6 years ago
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.
Before we even talk about a PR let's have a conversation about how this should be approached. There are many ways in which this can be done but all of them imply lots of changes to the existing code. Here are two that come immediately to mind.
I'm guessing I'm not the first one thinking about this and there might be already significant effort invested in the design of this feature. Let's discuss and agree on the best approach before spending lots of time to modify the code.
I dont see anyone from the community chiming in here. At the same time this has not been a requirement internally.
Lack of participation signals lack of interest from the community. Closing
Lack of participation signals lack of interest from the community. Closing
How many people from the community should vote for this issue to make you reopen it?
So which approach should we take for this? See the two options I layed out above (or it can be a new one...)
This would be a great feature in the embedded world! In many cases, we need to redirect the textual output to a variable and then return that content back to our desktop system in the near future. I second this.
Any workaround at this point?
Any progress on this? I am running on Android and don't see any output from my application so I currently expect this is my issue as from what I understand printf() goes to dev/nul
@CraigHutchinson for Android, I have this PR that's been waiting for almost a year: https://github.com/google/googletest/pull/3864
For the printf case, I attempted a macro solution in 2018 which was closed because macros are evil: https://github.com/google/googletest/pull/1201 and I tried again with a gtest_printf
solution last year but again, no interest to merge since: https://github.com/google/googletest/pull/3860
The default reporter (PrettyUnitTestResultPrinter) writes straight to stdout via printf calls. I would like to have an API so I can provide my own std::ostream, like boost Test library: https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/test_output/logging_api/log_ct_output_stream_redirection.html
This is useful when you use gtest as part of a bigger framework and you need to redirect to output somewhere else (or convert it on the fly to a different encoding for example).
If for running the tests I can at least work around the problem by writing an event listener and writing into my own stream, for listing the tests, there is no workaround since
ListTestsMatchingFilter
is not accessible and the listeners are not invoked for the list tests action.