mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Trying fix unit tests.
This commit is contained in:
@@ -54,13 +54,7 @@ internal class UnixMainLoop : IMainLoopDriver
|
||||
|
||||
public EscSeqRequests EscSeqRequests { get; } = new ();
|
||||
|
||||
void IMainLoopDriver.Wakeup ()
|
||||
{
|
||||
if (!ConsoleDriver.RunningUnitTests)
|
||||
{
|
||||
_eventReady.Set ();
|
||||
}
|
||||
}
|
||||
void IMainLoopDriver.Wakeup () { _eventReady.Set (); }
|
||||
|
||||
void IMainLoopDriver.Setup (MainLoop mainLoop)
|
||||
{
|
||||
|
||||
@@ -1844,6 +1844,12 @@ internal class NetMainLoop : IMainLoopDriver
|
||||
void IMainLoopDriver.Setup (MainLoop mainLoop)
|
||||
{
|
||||
_mainLoop = mainLoop;
|
||||
|
||||
if (ConsoleDriver.RunningUnitTests)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Task.Run (NetInputHandler, _inputHandlerTokenSource.Token);
|
||||
}
|
||||
|
||||
|
||||
@@ -2346,10 +2346,10 @@ internal class WindowsMainLoop : IMainLoopDriver
|
||||
public WindowsMainLoop (ConsoleDriver consoleDriver = null)
|
||||
{
|
||||
_consoleDriver = consoleDriver ?? throw new ArgumentNullException (nameof (consoleDriver));
|
||||
_winConsole = ((WindowsDriver)consoleDriver).WinConsole;
|
||||
|
||||
if (!ConsoleDriver.RunningUnitTests)
|
||||
{
|
||||
_winConsole = ((WindowsDriver)consoleDriver).WinConsole;
|
||||
_winConsole._mainLoop = this;
|
||||
}
|
||||
}
|
||||
@@ -2359,6 +2359,12 @@ internal class WindowsMainLoop : IMainLoopDriver
|
||||
void IMainLoopDriver.Setup (MainLoop mainLoop)
|
||||
{
|
||||
_mainLoop = mainLoop;
|
||||
|
||||
if (ConsoleDriver.RunningUnitTests)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Task.Run (WindowsInputHandler, _inputHandlerTokenSource.Token);
|
||||
#if HACK_CHECK_WINCHANGED
|
||||
Task.Run (CheckWinChange);
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Terminal.Gui.ApplicationTests;
|
||||
|
||||
public class SyncrhonizationContextTests
|
||||
{
|
||||
[Fact(Skip = "Causes ubuntu to crash in github action.")]
|
||||
[Fact]
|
||||
public void SynchronizationContext_CreateCopy ()
|
||||
{
|
||||
Application.Init ();
|
||||
@@ -20,11 +20,12 @@ public class SyncrhonizationContextTests
|
||||
|
||||
[Theory]
|
||||
[InlineData (typeof (FakeDriver))]
|
||||
//[InlineData (typeof (NetDriver))]
|
||||
[InlineData (typeof (NetDriver))]
|
||||
[InlineData (typeof (WindowsDriver))]
|
||||
//[InlineData (typeof (CursesDriver))]
|
||||
[InlineData (typeof (CursesDriver))]
|
||||
public void SynchronizationContext_Post (Type driverType)
|
||||
{
|
||||
ConsoleDriver.RunningUnitTests = true;
|
||||
Application.Init (driverName: driverType.Name);
|
||||
SynchronizationContext context = SynchronizationContext.Current;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user