Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/guiunit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan McGovern <alan.mcgovern@gmail.com>2016-09-01 01:26:02 +0300
committerAlan McGovern <alan.mcgovern@gmail.com>2016-09-01 01:26:02 +0300
commit0eaf2cc41fb52b6f5a4a609148f884f185518d98 (patch)
tree95a32a9030e33f94276580dfd86edd4a968c6ef8
parentba96edc32029ada79cdf040f7e7c523311faa24e (diff)
Add logging and make sure we always shut down
-rw-r--r--src/framework/GuiUnit/TestRunner.cs20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/framework/GuiUnit/TestRunner.cs b/src/framework/GuiUnit/TestRunner.cs
index ff4e987..56da295 100644
--- a/src/framework/GuiUnit/TestRunner.cs
+++ b/src/framework/GuiUnit/TestRunner.cs
@@ -223,8 +223,13 @@ namespace GuiUnit
} else {
MainLoop.InitializeToolkit ();
System.Threading.ThreadPool.QueueUserWorkItem (d => {
- RunTests (filter);
- Shutdown ();
+ try {
+ RunTests (filter);
+ } catch (Exception ex) {
+ Console.WriteLine ("Unexpected error while running the tests: {0}", ex);
+ } finally {
+ Shutdown ();
+ }
});
MainLoop.RunMainLoop ();
}
@@ -261,9 +266,14 @@ namespace GuiUnit
// Run the shutdown method on the main thread
var helper = new InvokerHelper {
Func = () => {
- if (BeforeShutdown != null)
- BeforeShutdown (null, EventArgs.Empty);
- MainLoop.Shutdown ();
+ try {
+ if (BeforeShutdown != null)
+ BeforeShutdown (null, EventArgs.Empty);
+ } catch (Exception ex) {
+ Console.WriteLine ("Unexpected error during `BeforeShutdown`: {0}", ex);
+ } finally {
+ MainLoop.Shutdown ();
+ }
return null;
}
};