Thread overview
unittests and Windows App
Dec 19, 2013
ref2401
Dec 19, 2013
evilrat
Dec 20, 2013
Rainer Schuetze
December 19, 2013
I'm using D 2064.2 and VisualD 0.3.37
VisualD "Redirect stdout to output window" checkbox is checked.

In simple ConsoleApp unittests work properly. I can debug them and assertion fail results are printed to the Output window.

But it seems that unittests don't work at all with any WindowsApp. It's impossible to debug and no assertion fail messages are printed to the Output windows.
December 19, 2013
On Thursday, 19 December 2013 at 13:55:41 UTC, ref2401 wrote:
> I'm using D 2064.2 and VisualD 0.3.37
> VisualD "Redirect stdout to output window" checkbox is checked.
>
> In simple ConsoleApp unittests work properly. I can debug them and assertion fail results are printed to the Output window.
>
> But it seems that unittests don't work at all with any WindowsApp. It's impossible to debug and no assertion fail messages are printed to the Output windows.

OutputDebugStringA/OutputDebugStringW[1] WinAPI function should work within visual studio.

[1] http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx
December 20, 2013

On 19.12.2013 14:55, ref2401 wrote:
> I'm using D 2064.2 and VisualD 0.3.37
> VisualD "Redirect stdout to output window" checkbox is checked.
>
> In simple ConsoleApp unittests work properly. I can debug them and
> assertion fail results are printed to the Output window.
>
> But it seems that unittests don't work at all with any WindowsApp. It's
> impossible to debug and no assertion fail messages are printed to the
> Output windows.

I think there was a recent change that Runtime.initialize would no longer run the unit tests, so you have to call runModuleUnitTests() yourself from within WinMain.