Skip to content

Commit

Permalink
Merge pull request #2730 from cwensley/curtis/fix-running-tests-in-th…
Browse files Browse the repository at this point in the history
…e-app

Don't when running tests with the test app
  • Loading branch information
cwensley authored Jan 25, 2025
2 parents 3c810ee + 788023f commit d7b9720
Showing 1 changed file with 5 additions and 0 deletions.
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;

Check warning on line 63 in test/Eto.Test/UnitTests/TestBase.cs

View workflow job for this annotation

GitHub Actions / build-mac

The field 'EtoTestSetup._quit' is assigned but its value is never used
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

0 comments on commit d7b9720

Please sign in to comment.