I have a set of unit tests using gtest as framework.
Build, and execute, and the output looks like this :
I'd like to have the output similar to the output when using cxxunit (.
when test pass, detail error when it fails). If possibly, with colors.
How to do this?
If I wasn't clear, I am looking for code and exact way how to do this.
The output should be something like :
Executing dummy_tests .....
../code/app/unit_tests/unittest_dummy.cpp:25: Failure
Value of: 2
Expected: 1
..
FAILED
I am trying to use this example and create custom listener. But the example doesn't have colorful output, and it prints lots of messages to the output.
As for the colorful output, developers implemented ColoredPrintf()
function.
As for the particular problem I am facing is lack of documentation :
- how to get information about whole tests suite at the program start? (I guess in the
OnTestProgramStart()
method) - how to get information about whether a test failed? (
OnTestProgramEnd()
? or other method?)