Search code examples
c++googletest

Google tests don't show report messages


Google test EXPECT and ASSERT macros don't show output text, that i try out with << operator

Project builds using CMake with MSVC compiler.

TEST(bar, foo)
{
    EXPECT_EQ(1, 1) << "Some text";
}

I expect somo output in console. But it is not


Solution

  • In this context operator << can be used to provide a custom failure message. Since 1 equals to 1 no failure happens and nothing is printed.