From c4b2e8892154d13b61e759bac6c492be437b2e46 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sun, 11 Jun 2017 07:59:13 -0700 Subject: [PATCH] Add Emulator test category --- PrinterEmulator/Emulator.cs | 2 ++ .../HardwareLevelingUITests.cs | 2 +- .../PrintingTests.cs | 16 ++++++++-------- .../SliceSettingsTests.cs | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/PrinterEmulator/Emulator.cs b/PrinterEmulator/Emulator.cs index 0059322d0..a72fd7406 100644 --- a/PrinterEmulator/Emulator.cs +++ b/PrinterEmulator/Emulator.cs @@ -284,6 +284,7 @@ namespace MatterHackers.PrinterEmulator while (!shutDown) { string line = ""; + try { line = serialPort.ReadLine(); // read a '\n' terminated line @@ -294,6 +295,7 @@ namespace MatterHackers.PrinterEmulator catch (Exception) { } + if (line.Length > 0) { Console.WriteLine(line); diff --git a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs index 221a696ff..cea006901 100644 --- a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs +++ b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs @@ -35,7 +35,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, overrideHeight: 800); } - [Test] + [Test, Category("Emulator")] public async Task SoftwareLevelingRequiredCorrectWorkflow() { await MatterControlUtilities.RunTest((testRunner) => diff --git a/Tests/MatterControl.AutomationTests/PrintingTests.cs b/Tests/MatterControl.AutomationTests/PrintingTests.cs index 1f60119d9..21027a1c4 100644 --- a/Tests/MatterControl.AutomationTests/PrintingTests.cs +++ b/Tests/MatterControl.AutomationTests/PrintingTests.cs @@ -16,7 +16,7 @@ namespace MatterHackers.MatterControl.Tests.Automation [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)] public class PrintingTests { - [Test] + [Test, Category("Emulator")] public async Task CompletingPrintTurnsoffHeat() { await MatterControlUtilities.RunTest((testRunner) => @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, maxTimeToRun: 200); } - [Test] + [Test, Category("Emulator")] public async Task PulseRequiresLevelingAndLevelingWorks() { await MatterControlUtilities.RunTest((testRunner) => @@ -113,7 +113,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, maxTimeToRun: 90); } - [Test] + [Test, Category("Emulator")] public void ExpectedEmulatorResponses() { string[] test1 = new string[] @@ -208,7 +208,7 @@ namespace MatterHackers.MatterControl.Tests.Automation } } - [Test] + [Test, Category("Emulator")] public async Task PrinterRequestsResumeWorkingAsExpected() { await MatterControlUtilities.RunTest((testRunner) => @@ -255,7 +255,7 @@ namespace MatterHackers.MatterControl.Tests.Automation private EventHandler unregisterEvents; - [Test] + [Test, Category("Emulator")] public async Task TuningAdjustmentsDefaultToOneAndPersists() { double targetExtrusionRate = 1.5; @@ -342,7 +342,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, overrideHeight:900, maxTimeToRun: 120); } - [Test] + [Test, Category("Emulator")] public async Task TuningAdjustmentControlsBoundToStreamValues() { double targetExtrusionRate = 1.5; @@ -435,7 +435,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, overrideHeight: 900, maxTimeToRun: 120); } - [Test] + [Test, Category("Emulator")] public async Task CancelingSdCardPrintLeavesHeatAndFanOn() { await MatterControlUtilities.RunTest((testRunner) => @@ -479,7 +479,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, overrideHeight: 900, maxTimeToRun: 90); } - [Test] + [Test, Category("Emulator")] public async Task CancelingNormalPrintTurnsHeatAndFanOff() { await MatterControlUtilities.RunTest((testRunner) => diff --git a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs index 9b234f35d..16be0d914 100644 --- a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs +++ b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs @@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, overrideWidth: 1224, overrideHeight: 800); } - [Test] + [Test, Category("Emulator")] public async Task PauseOnLayerDoesPauseOnPrint() { await MatterControlUtilities.RunTest((testRunner) => @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl.Tests.Automation }, maxTimeToRun: 120); } - [Test] + [Test, Category("Emulator")] public async Task CancelWorksAsExpected() { await MatterControlUtilities.RunTest((testRunner) =>