I have an nunit Test in C#, that calls a C# wrapper of a function in a C++ DLL.
The C++ code uses std::cerr to output various messages.
These messages cannot be redirected using nunit-console /out /err or /xml switch.
In nunit (the GUI version) the output does not appear anywhere.
I would like to be able to see this output in nunit (GUI version).
Ideally I would like to be able to access this output in the Test.
Thanks for any help.
Redirecting std::cerr is a matter of replacing the stream buffer with your own.
It is important to restore in original buffer before we exit. I don’t know what your wrapper looks like, but you can probably figure out how to make it read output.str().