Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't quit when running tests with the test app #2730

Merged
Merged
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
5 changes: 5 additions & 0 deletions test/Eto.Test/UnitTests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public override TestResult Execute(TestExecutionContext context)
public class EtoTestSetup
{
static bool _quit;
static bool _appWasCreated;

/// <summary>
/// Timeout for application initialization
Expand Down Expand Up @@ -157,6 +158,8 @@ public static void Initialize()
thread.Start();
if (!ev.WaitOne(ApplicationTimeout))
Assert.Fail("Could not initialize application");

_appWasCreated = true;
if (exception != null)
ExceptionDispatchInfo.Capture(exception).Throw();
}
Expand All @@ -173,6 +176,8 @@ public void GlobalSetup()
public void GlobalTeardown()
{
_quit = true;
if (!_appWasCreated)
return;
Application.Instance?.AsyncInvoke(() =>
{
Application.Instance?.Quit();
Expand Down
Loading