diff --git a/Terminal.Gui/Drivers/FakeDriver/FakeComponentFactory.cs b/Terminal.Gui/Drivers/FakeDriver/FakeComponentFactory.cs index db5be73a0..3700c2d03 100644 --- a/Terminal.Gui/Drivers/FakeDriver/FakeComponentFactory.cs +++ b/Terminal.Gui/Drivers/FakeDriver/FakeComponentFactory.cs @@ -36,6 +36,7 @@ public class FakeComponentFactory : ComponentFactoryImpl /// public override IInput CreateInput () { + // Use provided input instance or create a new one if none was provided FakeInput fakeInput = _input ?? new FakeInput (); // Check for test context in environment variable diff --git a/Terminal.Gui/Examples/ExampleRunner.cs b/Terminal.Gui/Examples/ExampleRunner.cs index 005714c89..5cea99b57 100644 --- a/Terminal.Gui/Examples/ExampleRunner.cs +++ b/Terminal.Gui/Examples/ExampleRunner.cs @@ -71,7 +71,7 @@ public static class ExampleRunner // If entry point returns Task, wait for it if (result is Task task) { - task.Wait (); + task.GetAwaiter ().GetResult (); } return new () @@ -126,7 +126,8 @@ public static class ExampleRunner { try { - process.Kill (true); + const bool killEntireProcessTree = true; + process.Kill (killEntireProcessTree); } catch { diff --git a/Tests/UnitTestsParallelizable/Examples/ExampleTests.cs b/Tests/UnitTestsParallelizable/Examples/ExampleTests.cs index 123f65374..63c8b8dc1 100644 --- a/Tests/UnitTestsParallelizable/Examples/ExampleTests.cs +++ b/Tests/UnitTestsParallelizable/Examples/ExampleTests.cs @@ -25,6 +25,9 @@ public class ExampleTests [RequiresDynamicCode ("Calls ExampleDiscovery.DiscoverFromDirectory")] public static IEnumerable AllExamples () { + // Navigate from test assembly location to repository root, then to Examples directory + // Test output is typically at: Tests/UnitTestsParallelizable/bin/Debug/net8.0/ + // Examples are at: Examples/ string examplesDir = Path.GetFullPath (Path.Combine (AppContext.BaseDirectory, "..", "..", "..", "..", "..", "Examples")); if (!Directory.Exists (examplesDir))