kookie424 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Report failing tests to stderr instead of stdout #232

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some editors and IDEs (Qt Creator for one) expect to see any compiler
errors output into stderr for their built-in "build problems" lists to
function properly when the tests are run as part of the build process, i.e.
for jump-to-error functionality to work. As of 1.4.0 libgtest reports even
failing tests into stdout.

To fix, it would be sufficient to conditionally fprintf() to stderr in
static void PrintTestPartResult() in src/gtest.cc:2495.

What steps will reproduce the problem?
1. Write faulty but compilable code
2. Write a test to expose the fault
3. Write a makefile that runs your tests
4. Build project with said makefile in Qt Creator
5. No errors in build issues panel

What is the expected output? What do you see instead?

- The failing tests (file/line) should be listed in the build issues panel

What version of the product are you using? On what operating system?

- libgtest 1.4.0 on Mac OS X 10.4

Original issue reported on code.google.com by ilkka.s....@gmail.com on 6 Dec 2009 at 2:38

GoogleCodeExporter commented 9 years ago
You can run your test with 1>&2 to redirect stdout to stderr, e.g.

  my_test 1>&2

Or you can write a new test result printer using the test event listener API.

Original comment by w...@google.com on 9 Dec 2009 at 11:13