/// <summary> /// Execute the tests in the assembly, passing in /// a list of arguments. /// </summary> /// <param name="args">arguments for NUnitLite to use</param> public void Execute() { #if TIZEN #region tronghieu.d - Create new thread to run test and mainthread waiting for invoke test method. TAsyncThreadMgr asyncThreadMgr = TAsyncThreadMgr.GetInstance(); ManualResetEvent methodExecutionResetEvent = asyncThreadMgr.GetMethodExecutionResetEvent(); methodExecutionResetEvent.Reset(); Task t = Task.Run(() => { _textRunner.Execute(args); asyncThreadMgr.SetData(null, null, null, null, false); methodExecutionResetEvent.Set(); }); t.GetAwaiter().OnCompleted(() => { OnSingleTestDone(TSettings.GetInstance().GetSingleTestDoneEventArgs()); }); methodExecutionResetEvent.WaitOne(); asyncThreadMgr.RunTestMethod(); #endregion #else new TextRunner(_testAssembly).Execute(args); #endif }
private void ProcessTest() { methodExecutionResetEvent.WaitOne(); if (asyncThreadMgr.RunTestMethod() == false) { mainTitle.Text = title + "Finished!\nWill be terminated after 5 seconds"; timer = new Timer(300); timer.Tick += OnTick; timer.Start(); return; } eventThreadCallback.Trigger(); }