title: Google Test C++: Is there a way to read the current console output in a test?
body: <p>Let us assume I have a to be tested class that has the following method:</p>
  
  <pre><code>void
  MyClass::sayHello()
  {
     std::cout &lt;&lt; "Hello";
  }
  </code></pre>
  
  <p>Now, within my google test I would like to verify that this output has been made. What would be the <em>lastConsoleOutput</em> equivalent be as used in my pseudo code below?</p>
  
  <pre><code>// Tests if sayHello() outputs Hello
  TEST(MyClassTest, sayHello)\
  {
    EXPECT_EQ(lastConsoleOutput,"Hello");
  }
  </code></pre>
  
  <p>Thank you for any feedback!</p>