Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/core/runtime.d
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ extern (C) bool runModuleUnitTests()

if( Runtime.sm_moduleUnitTester is null )
{
size_t failed = 0;
size_t total = 0;
foreach( m; ModuleInfo )
{
if( m )
Expand All @@ -503,19 +503,21 @@ extern (C) bool runModuleUnitTests()

if( fp )
{
++total;
try
{
fp();
}
catch( Throwable e )
{
_d_print_throwable(e);
failed++;
}
}
}
}
return failed == 0;
// Run main if and only if there was no unittest run. This is new
// behavior; previously, main would run if all unittests passed.
return total == 0;
}
return Runtime.sm_moduleUnitTester();
}
Expand Down