title: How to manage test output with google test in Eclipse CDT?
body: <p>I am developing C++ code with Eclipse CDT. For unit testing I use google test which I integrated into Eclipse via the "C++ Unit Testing" plugin. A problem now occurs when tests generate output to stdout, e.g., as in the example below.</p>
  
  <p>Test.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  #include "gtest/gtest.h"
  
  TEST(TestSuite, TestCase) {
      std::string s = "str";
      std::cout &lt;&lt; s;
      ASSERT_STREQ(s.c_str(), s.c_str());
  }
  </code></pre>
  
  <p>AllTest.cpp</p>
  
  <pre><code>#include "gtest/gtest.h"
  
  int main(int argc, char **argv) {
    ::testing::InitGoogleTest(&amp;argc, argv);
    return RUN_ALL_TESTS();
  }
  </code></pre>
  
  <p>After building and running a suitable run configuration (for "C/C++ Unit" with "Google Tests Runner"), the "C/C++ Unit" tab displays an error message on the top: "Unkown error during parsing Google Test module output: Unexpected test module output."</p>
  
  <p>When I run the test inside Eclipse as an application, it passes and the console shows the correct output. Tests also pass with the plugin as long as they do not generate any output (e.g., change the string in Test.cpp to the empty string, <code>std::string s = "";</code>)</p>
  
  <p>Is there any workaround to allow the execution of tests that generate output via the plugin? I know that I could, e.g., write the output to an ostream and and set that to be an ofstream during testing. However, I would prefer to test without any changes to the source code. Any ideas?</p>
  
  <p>I am not so used to programming in C++, so thanks a lot for any advice.</p>
  
  <p>P.S.: I am using Eclipse Oxygen (4.7.0).</p>