Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fix Issue 14350 - Unit test failures are not displayed in Windows GUI…
Browse files Browse the repository at this point in the history
… programs
  • Loading branch information
CyberShadow committed Mar 27, 2015
1 parent 95737c0 commit 6833d64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/core/runtime.d
Expand Up @@ -42,6 +42,7 @@ private
extern (C) TraceHandler rt_getTraceHandler();

alias void delegate( Throwable ) ExceptionHandler;
extern (C) void printThrowable(Throwable t);

extern (C) void* thread_stackBottom();

Expand Down Expand Up @@ -380,12 +381,6 @@ extern (C) bool runModuleUnitTests()

if( Runtime.sm_moduleUnitTester is null )
{
void printErr(in char[] buf)
{
import core.stdc.stdio : fprintf, stderr;
fprintf(stderr, "%.*s", cast(int)buf.length, buf.ptr);
}

size_t failed = 0;
foreach( m; ModuleInfo )
{
Expand All @@ -401,7 +396,7 @@ extern (C) bool runModuleUnitTests()
}
catch( Throwable e )
{
e.toString(&printErr); printErr("\n");
printThrowable(e);
failed++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/rt/dmain2.d
Expand Up @@ -460,7 +460,7 @@ private void formatThrowable(Throwable t, void delegate(in char[] s) nothrow sin
}
}

private void printThrowable(Throwable t)
extern (C) void printThrowable(Throwable t)
{
// On Windows, a console may not be present to print the output to.
// Show a message box instead.
Expand Down

0 comments on commit 6833d64

Please sign in to comment.