From d3ab94666fa19fa1966360c82d6d096e10907b22 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 31 May 2016 19:06:35 +0200 Subject: [PATCH] [tests] Avoid running more than once simultaneously. --- tests/watchos/Extension/InterfaceController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/watchos/Extension/InterfaceController.cs b/tests/watchos/Extension/InterfaceController.cs index dd01881495..f07ee8d4d0 100644 --- a/tests/watchos/Extension/InterfaceController.cs +++ b/tests/watchos/Extension/InterfaceController.cs @@ -15,6 +15,7 @@ namespace monotouchtestWatchKitExtension public partial class InterfaceController : WKInterfaceController { WatchOSRunner runner; + bool running; [Action ("runTests:")] partial void RunTests (NSObject obj); @@ -70,6 +71,11 @@ namespace monotouchtestWatchKitExtension void RunTests () { + if (running) { + Console.WriteLine ("Already running"); + return; + } + running = true; cmdRun.SetEnabled (false); lblStatus.SetText ("Running"); BeginInvokeOnMainThread (() => { @@ -78,6 +84,7 @@ namespace monotouchtestWatchKitExtension cmdRun.SetEnabled (true); lblStatus.SetText ("Done"); BeginInvokeOnMainThread (RenderResults); + running = false; }); }