title: Visual Studio Unit Test show cout messages from Function under test
body: <p>I have a setup very similar to <a href="https://msdn.microsoft.com/en-us/library/hh598953.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow noreferrer">this</a> with a Static Library project containing my functionality, as well a test project that obviously references and calls this code.</p>
  
  <p>I have the following test macro/function (basic example) (inside test project)</p>
  
  <pre><code>TEST_METHOD(Foo_Test)
  {
      Foo.HelloWorld();
  }
  </code></pre>
  
  <p>which calls the following function (inside static lib):</p>
  
  <pre><code>void Foo::HelloWorld()
  {
      std::cout &lt;&lt; "Hello World" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>When I run this code through the test explorer tab my test passes fine (obviously in this simple example as there are no asserts) but I don't seem to have any way of analysing the output as it does not go out to console.</p>
  
  <p>It's important to me that my Foo class stays completely portable and does not include any Microsoft or Test specific code, I believe I should be able to test my code through its interface.</p>
  
  <p>My question, why can't I see this output and is there a way I can enable to console output for the messages generated from my unit under test.</p>