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

Commit

Permalink
Merge pull request #1200 from CyberShadow/pull-20150327-170332
Browse files Browse the repository at this point in the history
fix Issue 14350 - Unit test failures are not displayed in Windows GUI pr...
  • Loading branch information
MartinNowak committed Apr 7, 2015
2 parents a55e676 + bed8a4d commit de0c849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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 _d_print_throwable(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");
_d_print_throwable(e);
failed++;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/rt/dmain2.d
Expand Up @@ -175,7 +175,7 @@ extern (C) int rt_init()
catch (Throwable t)
{
_initCount = 0;
printThrowable(t);
_d_print_throwable(t);
}
_STD_critical_term();
_STD_monitor_staticdtor();
Expand All @@ -201,7 +201,7 @@ extern (C) int rt_term()
}
catch (Throwable t)
{
printThrowable(t);
_d_print_throwable(t);
}
finally
{
Expand Down Expand Up @@ -398,7 +398,7 @@ extern (C) int _d_run_main(int argc, char **argv, MainFunc mainFunc)
}
catch (Throwable t)
{
printThrowable(t);
_d_print_throwable(t);
result = EXIT_FAILURE;
}
}
Expand Down 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 _d_print_throwable(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 de0c849

Please sign in to comment.