From b1842e58fefef06fd0f102f7a2bd15eada1c9df5 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sun, 11 Jun 2017 09:58:25 -0700 Subject: [PATCH] Explicitly close MatterControl on test conclusion --- Submodules/agg-sharp | 2 +- .../MatterControl/MatterControlUtilities.cs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index eef74d845..c7e6e0577 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit eef74d845619cea7d82ad3e3df3053c30f60ef18 +Subproject commit c7e6e05770146a303040aba662536e85ced5f20d diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index c4b57862b..ff9669690 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -485,7 +485,17 @@ namespace MatterHackers.MatterControl.Tests.Automation // Extract mouse speed from config AutomationRunner.TimeToMoveMouse = config.TimeToMoveMouse; - await AutomationRunner.ShowWindowAndExecuteTests(matterControlWindow, testMethod, maxTimeToRun, defaultTestImages, config.AutomationInputType); + await AutomationRunner.ShowWindowAndExecuteTests(matterControlWindow, testMethod, maxTimeToRun, defaultTestImages, config.AutomationInputType, () => + { + if (PrinterConnectionAndCommunication.Instance.CommunicationState == PrinterConnectionAndCommunication.CommunicationStates.Printing) + { + PrinterConnectionAndCommunication.Instance.Disable(); + } + + MatterControlApplication app = MatterControlApplication.Instance; + app.RestartOnClose = false; + app.Close(); + }); } public static void LibraryAddSelectionToQueue(AutomationRunner testRunner)