Just xml output to stdout

660 views
Skip to first unread message

hoj

unread,
Jun 12, 2011, 3:58:01 PM6/12/11
to Google C++ Testing Framework
Hello,
I would like to get the xml report on stdout instead of the regular,
non-xml output. I am running the test on an embedded device and I use
netcat to send stdout to a machine driving the tests.

I have tried this:
./a_test --gtest_output="xml:/dev/stdout"
, but the output is mixed xml and non-xml output.

I've also tried --gtest_output="xml:" but that saves to a default
file.

Any way to get just xml?

Thanks!
,
hoj

immort

unread,
Jun 13, 2011, 9:22:01 PM6/13/11
to Google C++ Testing Framework
./test --gtest_output=xml:../gtest.xml

This is what I do on CI server, the output is pure xml and could be
read just as the result of JUnit test report.

Vlad Losev

unread,
Jun 17, 2011, 12:28:03 AM6/17/11
to hoj, Google C++ Testing Framework
You can shut down Google Test's regular console output using the event listener API, but the output from the code under test can still pollute the XML. As an alternative, you can obtain some structured information about test execution using the  --gtest_stream_result_to flag.

John Faith

unread,
Jun 17, 2011, 11:37:08 AM6/17/11
to Google C++ Testing Framework
Hi Vlad,
Thanks for the suggestions. It sounds like using the event API would
require changing each test source file to discard the regular output.

I tried using --gtest_stream_result_to with --gtest_output=xml, but
the result I got across the network was in the format
"gtest_streaming_protocol_version=1.0"

Thanks,
John

Reply all
Reply to author
Forward
0 new messages