Redirecting google test stdio

130 views
Skip to first unread message

Craig Henderson

unread,
Jan 31, 2017, 11:29:28 AM1/31/17
to Google C++ Testing Framework
I am the architect of a software test suite at Intel Corp.

The test suite uses gtest and gmock but must soon run in an environment where gtest cannot be allowed to print to stdio.

Our preferred architecture would be to stream google test output to a socket, but file would do too.

I know about such mechanisms as freopen, Prefer another way as it limits us from using a socket.

I find the GTEST_CAN_STREAM_RESULTS_ conditions in the gtest code and wonder if it can be leveraged for this?

The system is Windows 10 and linux.

Thank You

Craig Henderson

Staff Engineer
Intel Corporaration
Hillsboro, Oregon


Craig Henderson

unread,
Jan 31, 2017, 12:18:28 PM1/31/17
to Google C++ Testing Framework
Also FYI, the Windows development system in use is Visual Studio 2015 Update 2

Tor Didriksen

unread,
Feb 1, 2017, 6:02:00 AM2/1/17
to Craig Henderson, Google C++ Testing Framework
Hello

You can probably write your own TestEventListener, and remove the default PrettyUnitTestResultPrinter
We have done that for MySQL unit tests. Not for redirecting output, but for reformatting.

-- didrik

--

---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages