3

Is there a way to print messages to output window with CppUnitTestFramework in Visual Studio.
There is TRACE() function to display messages from program in the debugger Output window in MFC.
I want to know whether that kind of function exists or not with CppUnitTestFramework.

1

1 Answer 1

3

The Logger class in the CppUnitTestFramework namespace has two simple functions for this:

Logger::WriteMessage(const wchar_t* message);
Logger::WriteMessage(const char* message);

In the VS IDE, the output can be seen in the "Tests" console output window and can also by clicking the "Output" link seen in the detail panel at the bottom of the Test Explorer.

On a build server the message will appear in the log for the test phase.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.