From c4cac518e169b5d53a6fdf51d123158448133820 Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Wed, 26 Feb 2014 12:21:05 -0800 Subject: [PATCH] Make MatterControl exit if errors occur. --- MatterControlApplication.cs | 4 ++++ Testing/TestingDispatch.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs index c75aaecda..67994822c 100644 --- a/MatterControlApplication.cs +++ b/MatterControlApplication.cs @@ -83,6 +83,10 @@ namespace MatterHackers.MatterControl commandLineArgs.CopyTo(testCommands, 2); } testDispatch.RunTests(testCommands); + if (testDispatch.HadErrors) + { + return; + } } //WriteTestGCodeFile(); diff --git a/Testing/TestingDispatch.cs b/Testing/TestingDispatch.cs index 7111d119a..8d026bd30 100644 --- a/Testing/TestingDispatch.cs +++ b/Testing/TestingDispatch.cs @@ -9,6 +9,9 @@ namespace MatterHackers.MatterControl.Testing { public class TestingDispatch { + bool hadErrors = false; + public bool HadErrors { get { return hadErrors; } } + string errorLogFileName = null; public TestingDispatch() { @@ -32,6 +35,7 @@ namespace MatterHackers.MatterControl.Testing void DumpException(Exception e) { + hadErrors = true; using (StreamWriter w = File.AppendText(errorLogFileName)) { w.WriteLine(e.Message);