-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::cout goes to Test Explorer output window #134
Comments
Yes - we think that if a test fails, all output it generated could be of interest. Do you object, or were you just worried about the difference between information provided by the xml output file and the test adapter? Btw: You are going to see that output in the xml file produced by |
I would suggest several things:
Maybe there are other considerations that I can't think of and if you still think this is the right behavior at least try to add configuration flag to capture all the messages or just the message from the ASSERT / EXPECT macros. Thanks and regards. |
Ok, we have two issues here: First, we never noticed that the output happening before the first assertion is indeed not printed out - this is a bug which we will fix. Thanks for reporting! Second, there are situations where the code to be tested prints out statements which are important for understanding the test's failure, and where this is out of control of the tester. That's why we still think that it's a good idea to print out the complete test output. We will however consider an option to switch this off. |
OK, Thanks. |
I was a bit too optimistic about being able to switch this off, I fear. Here's the thing:
Thus, the only option appears to be offering that last behavior as an option. Before we do that, please elaborate on your use case - so far we haven't heard any complaints about our approach, so we would like to understand exactly why we would add that option. |
Regardless of my specific use case, I thought the GTA purpose is to duplicate the MS Test behavior under the google test framework, if this is true then in MS Test all the outputs of Logger:: WriteMessage(…) goes out only to the Output window and not to the TestExplorer window so if we like to keep the same behavior we should do the same. More over I think people didn't complain about this because it didn't works correctly. Although I think showing in the TestExplorer all the prints is wrong I trust yours opinion and yours decision. Thanks and regards. |
Ok, thanks for your thoughts. The missing output bug is fixed with the upcoming 0.10.0 release. We will for now close this bug and see if the issue comes up again - an optional XML only mode seems possible (with some disadvantages as described). |
Hello,
Consider this simple test:
TEST(aaa, bbb_2) {
EXPECT_EQ(10, 20) << "error 1";
for (int i = 0; i < 10 ; ++i) std::cout << "debug text line " << i << "\n";
EXPECT_EQ(10, 30) << "error 2";
}
The output of the test in the Test Explorer is:
The std::cout messages are not part of the xml output file.
Is it intended that the std::cout messages will be displayed in the Test Explorer output window?
The text was updated successfully, but these errors were encountered: