Can anyone tell me how to enable or get debug or console text output when running unit tests in a native (C++) test project in Visual Studio 2012?
Answer should not include the phrase, "use Google Test".
Can anyone tell me how to enable or get debug or console text output when running unit tests in a native (C++) test project in Visual Studio 2012?
Answer should not include the phrase, "use Google Test".
In the unit test code, you can use
Logger::WriteMessage("My message string");
and the message will appear in the Output window.
Brian's answer is correct. Use
Logger::WriteMessage("some text");
and run the test normally (there is no need to debug). However, you also need to select "Tests" in the "Show output from" drop-down list at the top of the Output window.
The debug output shows in the debug output window if you right-click and choose `debug' on whichever test in the test explorer window. Otherwise it doesn't.