I'm using the googletest C++ testing framework. Normally the textual output of running a test looks like this:
[ RUN ] MyTest.Fuzz [ OK ] MyTest.Fuzz (1867 ms)
I would like to output some additional data in the same format, for example:
[ RUN ] MyTest.Fuzz [ ] random seed = 1319760587 [ OK ] MyTest.Fuzz (1867 ms)
I have found Logging Additional Information in the googletest documentation but that only seems to send structured data to the XML output, not the standard console output.
Is there a googletest function I can call inside my unit test that outputs text in this format? Manually sending data to cout
works, but it doesn't include the usual coloured output so I have to explicitly indent the output by printing 13 spaces or whatever.
Simply printing to stderr will work in the default test configuration.
std::cerr << "[ ] random seed = " << random_seed << std::endl;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With