public IAsyncOperation RunTest(UnitTest test, IExecutionHandler context) { var result = RunTest(test, context, IdeApp.Preferences.BuildBeforeRunningTests); result.Completed += (OperationHandler)DispatchService.GuiDispatch(new OperationHandler(OnTestSessionCompleted)); return(result); }
public IDisposable CreateExternalProcessObject(Type type, IExecutionHandler executionHandler, IList <string> userAssemblyPaths = null, OperationConsole console = null) { CheckRemoteType(type); var hc = GetHost(type.ToString(), false, executionHandler); return((IDisposable)hc.CreateInstance(type.Assembly.Location, type.FullName, GetRequiredAddins(type), userAssemblyPaths, console)); }
public override IExecutionHandler GetExecutionHandler () { if (handler == null) handler = new IronPythonExecutionHandler (); return handler; }
public Task Connect (NUnitVersion version, IExecutionHandler executionHandler = null, OperationConsole console = null) { var exePath = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), version.ToString (), "NUnitRunner.exe"); connection = new RemoteProcessConnection (exePath, executionHandler, console, Runtime.MainSynchronizationContext); connection.AddListener (this); return connection.Connect (); }
AsyncOperation RunTest(ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) { if (nav == null) { return(null); } UnitTest test = nav.DataItem as UnitTest; if (test == null) { return(null); } UnitTestService.ResetResult(test.RootTest); this.buttonRunAll.Sensitive = false; this.buttonStop.Sensitive = true; ExecutionContext context = new ExecutionContext(mode, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, null); if (bringToFront) { IdeApp.Workbench.GetPad <TestPad> ().BringToFront(); } runningTestOperation = UnitTestService.RunTest(test, context); runningTestOperation.Task.ContinueWith(t => OnTestSessionCompleted(), TaskScheduler.FromCurrentSynchronizationContext()); return(runningTestOperation); }
IAsyncOperation RunTest(ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) { if (nav == null) { return(null); } UnitTest test = nav.DataItem as UnitTest; if (test == null) { return(null); } NUnitService.ResetResult(test.RootTest); this.buttonRunAll.Sensitive = false; this.buttonStop.Sensitive = true; if (bringToFront) { IdeApp.Workbench.GetPad <TestPad> ().BringToFront(); } runningTestOperation = testService.RunTest(test, mode); runningTestOperation.Completed += (OperationHandler)DispatchService.GuiDispatch(new OperationHandler(OnTestSessionCompleted)); return(runningTestOperation); }
protected override void Run(object dataItem) { IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand(dataItem); IBuildTarget target = IdeApp.ProjectOperations.CurrentSelectedBuildTarget; if (h == null || !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { return; } if (!IdeApp.Preferences.BuildBeforeExecuting) { IdeApp.ProjectOperations.Execute(target, h); } else { IAsyncOperation asyncOperation = IdeApp.ProjectOperations.Build(target); asyncOperation.Completed += delegate { if ((asyncOperation.Success) || (IdeApp.Preferences.RunWithWarnings && asyncOperation.SuccessWithWarnings)) { IdeApp.ProjectOperations.Execute(target, h); } }; } }
public IAsyncOperation RunTest(UnitTest test, IExecutionHandler context, bool buildOwnerObject) { string testName = test.FullName; if (buildOwnerObject) { IBuildTarget bt = test.OwnerObject as IBuildTarget; if (bt != null && bt.NeedsBuilding(IdeApp.Workspace.ActiveConfiguration)) { if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations(); IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted(); } AsyncOperation retOper = new AsyncOperation(); IAsyncOperation op = IdeApp.ProjectOperations.Build(bt); retOper.TrackOperation(op, false); op.Completed += delegate { // The completed event of the build operation is run in the gui thread, // so we need a new thread, because refreshing must be async System.Threading.ThreadPool.QueueUserWorkItem(delegate { if (op.Success) { RefreshTests(); test = SearchTest(testName); if (test != null) { Gtk.Application.Invoke(delegate { // RunTest must run in the gui thread retOper.TrackOperation(RunTest(test, context, false), true); }); } else { retOper.SetCompleted(false); } } }); }; return(retOper); } } Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>(); if (resultsPad == null) { resultsPad = IdeApp.Workbench.ShowPad(new TestResultsPad(), "MonoDevelop.NUnit.TestResultsPad", GettextCatalog.GetString("Test results"), "Bottom", "md-solution"); } resultsPad.BringToFront(); TestSession session = new TestSession(test, context, (TestResultsPad)resultsPad.Content); session.Start(); return(session); }
public AsyncOperation RunTest(UnitTest test, IExecutionHandler context) { var result = RunTest(test, context, IdeApp.Preferences.BuildBeforeRunningTests); result.Task.ContinueWith(t => OnTestSessionCompleted(), TaskScheduler.FromCurrentSynchronizationContext()); return(result); }
public bool IsValidForRemoteHosting(IExecutionHandler handler) { string location = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); location = Path.Combine(location, "mdhost.exe"); return(handler.CanExecute(new DotNetExecutionCommand(location))); }
public Task Connect(NUnitVersion version, IExecutionHandler executionHandler = null, OperationConsole console = null) { var exePath = Path.Combine(Path.GetDirectoryName(GetType().Assembly.Location), version.ToString(), "NUnitRunner.exe"); connection = new RemoteProcessConnection(exePath, executionHandler, console, Runtime.MainSynchronizationContext); connection.AddListener(this); return(connection.Connect()); }
public TestSession(UnitTest test, IExecutionHandler context, TestResultsPad resultsPad) { this.test = test; this.context = context; this.monitor = new TestMonitor(resultsPad); this.resultsPad = resultsPad; resultsPad.InitializeTestRun(test); }
public bool CanRun(IExecutionHandler executionContext) { if (executionContext == null) { executionContext = Runtime.ProcessService.DefaultExecutionHandler; } return(OnCanRun(executionContext)); }
protected void OnRunTest(object data) { IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand(data); if (h != null) { RunSelectedTest(h); } }
protected override void Run(object dataItem) { IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand(dataItem); if (h != null) { RunHandler.RunMethod(h); } }
public override IExecutionHandler GetExecutionHandler() { if (handler == null) { handler = new CPythonExecutionHandler(); } return(handler); }
public bool CanExecute (IExecutionHandler handler) { if (runCheckDelegate != null) return runCheckDelegate (handler); else if (cmd != null) return handler.CanExecute (cmd); else return false; }
public TestContext (ITestProgressMonitor monitor, IExecutionHandler executionContext, DateTime testDate) { this.monitor = monitor; if (executionContext == null) executionContext = Runtime.ProcessService.DefaultExecutionHandler; this.executionContext = executionContext; // Round to seconds this.testDate = new DateTime ((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond); }
public ExecutionContext (IExecutionHandler executionHandler, IConsoleFactory consoleFactory, ExecutionTarget target) { var targetedHandler = executionHandler as ITargetedExecutionHandler; if (targetedHandler != null) target = targetedHandler.Target ?? target; this.executionHandler = executionHandler; this.consoleFactory = consoleFactory; this.executionTarget = target; }
public TestSession(UnitTest test, IExecutionHandler context, TestResultsPad resultsPad, CancellationTokenSource cs) { this.test = test; this.context = context; CancellationTokenSource = cs; this.monitor = new TestMonitor(resultsPad, CancellationTokenSource); this.resultsPad = resultsPad; resultsPad.InitializeTestRun(test); Task = new Task(RunTests); }
public ProcessHostController (string id, uint stopDelay, IExecutionHandler executionHandlerFactory) { if (string.IsNullOrEmpty (id)) id = "?"; this.id = id; this.stopDelay = stopDelay; this.executionHandlerFactory = executionHandlerFactory; timer = new Timer (); timer.AutoReset = false; timer.Elapsed += new System.Timers.ElapsedEventHandler (WaitTimeout); }
public TestContext(ITestProgressMonitor monitor, IExecutionHandler executionContext, DateTime testDate) { this.monitor = monitor; if (executionContext == null) { executionContext = Runtime.ProcessService.DefaultExecutionHandler; } this.executionContext = executionContext; // Round to seconds this.testDate = new DateTime((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond); }
public static bool CanRun(IExecutionHandler executionHandler) { if (IdeApp.Workspace.IsOpen) { return(IdeApp.ProjectOperations.CurrentSelectedSolution != null && IdeApp.ProjectOperations.CanExecute(IdeApp.ProjectOperations.CurrentSelectedSolution, executionHandler)); } else { return((IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.CanRun(executionHandler))); } }
public static bool CanRun(IExecutionHandler executionHandler) { if (IdeApp.Workspace.IsOpen) { var target = GetRunTarget(); return(target != null && IdeApp.ProjectOperations.CanExecute(target, executionHandler)); } else { return(false); } }
public static bool CanRun(IExecutionHandler executionHandler) { if (IdeApp.Workspace.IsOpen) { var target = GetRunTarget(); return(target != null && IdeApp.ProjectOperations.CanExecute(target, executionHandler)); } else { return((IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.CanRun(executionHandler))); } }
public RemoteProcessConnection (string exePath, IExecutionHandler executionHandler = null, OperationConsole console = null, SynchronizationContext syncContext = null) { if (executionHandler == null) executionHandler = Runtime.ProcessService.DefaultExecutionHandler; if (console == null) console = new ProcessHostConsole (); this.executionHandler = executionHandler; this.exePath = exePath; this.syncContext = syncContext; this.console = console; mainCancelSource = new CancellationTokenSource (); }
protected override void Run(object dataItem) { IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand(dataItem); IBuildTarget target = IdeApp.ProjectOperations.CurrentSelectedBuildTarget; if (h == null || !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { return; } IdeApp.ProjectOperations.Execute(target, h); }
protected override void DoExecute(IProgressMonitor monitor, ExecutionContext context) { CProjectConfiguration conf = (CProjectConfiguration)ActiveConfiguration; string command = conf.Output; string args = conf.CommandLineParameters; string dir = Path.GetFullPath(conf.OutputDirectory); string platform = "Native"; bool pause = conf.PauseConsoleOutput; IConsole console; if (conf.CompileTarget != CBinding.CompileTarget.Bin) { IdeApp.Services.MessageService.ShowMessage("Compile target is not an executable!"); return; } monitor.Log.WriteLine("Running project..."); if (conf.ExternalConsole) { console = context.ExternalConsoleFactory.CreateConsole(!pause); } else { console = context.ConsoleFactory.CreateConsole(!pause); } AggregatedOperationMonitor operationMonitor = new AggregatedOperationMonitor(monitor); try { IExecutionHandler handler = context.ExecutionHandlerFactory.CreateExecutionHandler(platform); if (handler == null) { monitor.ReportError("Cannot execute \"" + command + "\". The selected execution mode is not supported in the " + platform + " platform.", null); return; } IProcessAsyncOperation op = handler.Execute(Path.Combine(dir, command), args, dir, console); operationMonitor.AddOperation(op); op.WaitForCompleted(); monitor.Log.WriteLine("The operation exited with code: {0}", op.ExitCode); } catch (Exception ex) { monitor.ReportError("Cannot execute \"" + command + "\"", ex); } finally { operationMonitor.Dispose(); console.Dispose(); } }
public void Start() { lock (this) { if (starting) { return; } starting = true; exitRequestEvent.Reset(); RemotingService.RegisterRemotingChannel(); BinaryFormatter bf = new BinaryFormatter(); ObjRef oref = RemotingServices.Marshal(this); MemoryStream ms = new MemoryStream(); bf.Serialize(ms, oref); string sref = Convert.ToBase64String(ms.ToArray()); string tmpFile = null; if (executionHandlerFactory == null) { executionHandlerFactory = Runtime.SystemAssemblyService.CurrentRuntime.GetExecutionHandler(); } try { string location = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); location = Path.Combine(location, "mdhost.exe"); ProcessHostConsole cons = new ProcessHostConsole(); tmpFile = Path.GetTempFileName(); File.WriteAllText(tmpFile, sref + "\n" + Process.GetCurrentProcess().Id + "\n"); string arguments = string.Format("{0} \"{1}\"", id, tmpFile); DotNetExecutionCommand cmd = new DotNetExecutionCommand(location, arguments, AppDomain.CurrentDomain.BaseDirectory); cmd.DebugMode = isDebugMode; process = executionHandlerFactory.Execute(cmd, cons); Counters.ExternalHostProcesses++; process.Completed += ProcessExited; } catch (Exception ex) { if (tmpFile != null) { try { File.Delete(tmpFile); } catch { } } LoggingService.LogError(ex.ToString()); throw; } } }
public ExecutionPipeline Add(IExecutionHandler handler, Services.IPredication predication = null) { if (handler == null) { throw new ArgumentNullException("handler"); } var item = new ExecutionPipeline(handler, predication); base.Add(item); return(item); }
protected virtual async Task RunTests(Project testProject) { IExecutionHandler mode = null; ExecutionContext context = new ExecutionContext(mode, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, null); var firstRootTest = UnitTestService.FindRootTest(testProject); if (coverageCollectionCompletion != null || firstRootTest == null || !firstRootTest.CanRun(mode)) { return; } coverageCollectionCompletion = new TaskCompletionSource <bool>(); await UnitTestService.RunTest(firstRootTest, context, true).Task; }
public ProcessHostController(string id, uint stopDelay, IExecutionHandler executionHandlerFactory) { if (string.IsNullOrEmpty(id)) { id = "?"; } this.id = id; this.stopDelay = stopDelay; this.executionHandlerFactory = executionHandlerFactory; timer = new Timer(); timer.AutoReset = false; timer.Elapsed += new System.Timers.ElapsedEventHandler(WaitTimeout); }
public ExecutionContext(IExecutionHandler executionHandler, OperationConsoleFactory consoleFactory, ExecutionTarget target) { var targetedHandler = executionHandler as ITargetedExecutionHandler; if (targetedHandler != null) { target = targetedHandler.Target ?? target; } this.executionHandler = executionHandler; this.consoleFactory = consoleFactory; this.executionTarget = target; }
public BackTest( IEventBus eventBus, IDataHandler bars, IStrategy strategy, IPortfolio portfolio, IExecutionHandler executionHandler) { this.eventBus = eventBus; this.bars = bars; this.strategy = strategy; this.portfolio = portfolio; this.executionHandler = executionHandler; this.stopWatch = new Stopwatch(); }
public static void RunMethod(IExecutionHandler executionHandler) { if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { if (!MessageService.Confirm(GettextCatalog.GetString("An application is already running. Do you want to stop it?"), AlertButton.Stop)) { return; } StopHandler.StopBuildOperations(); IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted(); } if (!IdeApp.Workspace.IsOpen) { if (!IdeApp.Preferences.BuildBeforeExecuting) { IdeApp.Workbench.ActiveDocument.Run(executionHandler); } else { IAsyncOperation asyncOperation = IdeApp.Workbench.ActiveDocument.Build(); asyncOperation.Completed += delegate { if ((asyncOperation.Success) || (IdeApp.Preferences.RunWithWarnings && asyncOperation.SuccessWithWarnings)) { IdeApp.Workbench.ActiveDocument.Run(executionHandler); } }; } } else { if (!IdeApp.Preferences.BuildBeforeExecuting) { IdeApp.ProjectOperations.Execute(IdeApp.ProjectOperations.CurrentSelectedSolution, executionHandler); } else { Solution sol = IdeApp.ProjectOperations.CurrentSelectedSolution; IAsyncOperation asyncOperation = IdeApp.ProjectOperations.Build(sol); asyncOperation.Completed += delegate { if ((asyncOperation.Success) || (IdeApp.Preferences.RunWithWarnings && asyncOperation.SuccessWithWarnings)) { IdeApp.ProjectOperations.Execute(sol, executionHandler); } }; } } }
AsyncOperation RunTest(ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) { if (nav == null) { return(null); } UnitTest test = nav.DataItem as UnitTest; if (test == null) { return(null); } return(RunTests(new UnitTest [] { test }, mode, bringToFront)); }
//TODO add cache support internal static void Process(List <string> executionHandlers, HttpContext context) { if (executionHandlers == null || executionHandlers.Count == 0) { return; } foreach (string typeName in executionHandlers) { IExecutionHandler handler = InstanceHelper.Create <IExecutionHandler>(typeName); handler.Process(context); } }
internal IAsyncOperation RunTest (UnitTest test, IExecutionHandler context, bool buildOwnerObject, bool checkCurrentRunOperation) { string testName = test.FullName; if (buildOwnerObject) { IBuildTarget bt = test.OwnerObject as IBuildTarget; if (bt != null && bt.NeedsBuilding (IdeApp.Workspace.ActiveConfiguration)) { if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations (); IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted (); } AsyncOperation retOper = new AsyncOperation (); IAsyncOperation op = IdeApp.ProjectOperations.Build (bt); retOper.TrackOperation (op, false); op.Completed += delegate { // The completed event of the build operation is run in the gui thread, // so we need a new thread, because refreshing must be async System.Threading.ThreadPool.QueueUserWorkItem (delegate { if (op.Success) { RefreshTests (); test = SearchTest (testName); if (test != null) { Gtk.Application.Invoke (delegate { // RunTest must run in the gui thread retOper.TrackOperation (RunTest (test, context, false), true); }); } else retOper.SetCompleted (false); } }); }; return retOper; } } if (checkCurrentRunOperation && !IdeApp.ProjectOperations.ConfirmExecutionOperation ()) return NullProcessAsyncOperation.Failure; Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>(); if (resultsPad == null) { resultsPad = IdeApp.Workbench.ShowPad (new TestResultsPad (), "MonoDevelop.NUnit.TestResultsPad", GettextCatalog.GetString ("Test results"), "Bottom", "md-solution"); } // Make the pad sticky while the tests are runnig, so the results pad is always visible (even if minimized) // That's required since when running in debug mode, the layout is automatically switched to debug. resultsPad.Sticky = true; resultsPad.BringToFront (); TestSession session = new TestSession (test, context, (TestResultsPad) resultsPad.Content); session.Completed += delegate { Gtk.Application.Invoke (delegate { resultsPad.Sticky = false; }); }; OnTestSessionStarting (new TestSessionEventArgs { Session = session, Test = test }); session.Start (); if (checkCurrentRunOperation) IdeApp.ProjectOperations.CurrentRunOperation = session; return session; }
public IAsyncOperation RunTest (UnitTest test, IExecutionHandler mode) { return RunTest (FindTestNode (test), mode, false); }
public IAsyncOperation ExecuteFile (string file, IExecutionHandler handler) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget); return ExecuteFile (file, context); }
public TargetedExecutionHandler (IExecutionHandler handler, ExecutionTarget target) { Target = target; Handler = handler; }
void RunSelectedTest (IExecutionHandler mode) { RunTest (TreeView.GetSelectedNode (), mode); }
public ExecutionContext (IExecutionHandler executionHandler, IConsoleFactory consoleFactory) { this.executionHandler = executionHandler; this.consoleFactory = consoleFactory; }
public bool CanExecuteFile (string file, IExecutionHandler handler) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget); return CanExecuteFile (file, context); }
public IAsyncOperation Execute (IBuildTarget entry, IExecutionHandler handler) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors); return Execute (entry, context); }
public static void RunMethod (IExecutionHandler executionHandler) { if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) { if (!MessageService.Confirm (GettextCatalog.GetString ("An application is already running. Do you want to stop it?"), AlertButton.Stop)) return; StopHandler.StopBuildOperations (); IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted (); } if (!IdeApp.Workspace.IsOpen) { if (!IdeApp.Preferences.BuildBeforeExecuting) IdeApp.Workbench.ActiveDocument.Run (executionHandler); else { IAsyncOperation asyncOperation = IdeApp.Workbench.ActiveDocument.Build (); asyncOperation.Completed += delegate { if ((asyncOperation.Success) || (IdeApp.Preferences.RunWithWarnings && asyncOperation.SuccessWithWarnings)) IdeApp.Workbench.ActiveDocument.Run (executionHandler); }; } return; } var target = GetRunTarget (); var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (target); op.Completed += delegate { if (op.Success) IdeApp.ProjectOperations.Execute (target, executionHandler); }; }
public static bool CanRun (IExecutionHandler executionHandler) { if (IdeApp.Workspace.IsOpen) { var target = GetRunTarget (); return target != null && IdeApp.ProjectOperations.CanExecute (target, executionHandler); } else return (IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.CanRun (executionHandler)); }
public IAsyncOperation RunTest (UnitTest test, IExecutionHandler context) { var result = RunTest (test, context, IdeApp.Preferences.BuildBeforeRunningTests); result.Completed += (OperationHandler) DispatchService.GuiDispatch (new OperationHandler (OnTestSessionCompleted)); return result; }
public IAsyncOperation RunTest (UnitTest test, IExecutionHandler context) { return RunTest (test, context, IdeApp.Preferences.BuildBeforeExecuting); }
public AsyncOperation Execute (IBuildTarget entry, IExecutionHandler handler, bool buildBeforeExecuting = true) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget); return Execute (entry, context, buildBeforeExecuting); }
public IAsyncOperation RunTest (UnitTest test, IExecutionHandler context, bool buildOwnerObject) { return RunTest (test, context, buildOwnerObject, true); }
public TestSession (UnitTest test, IExecutionHandler context, TestResultsPad resultsPad) { this.test = test; this.context = context; this.monitor = new TestMonitor (resultsPad); }
public TestSession (UnitTest test, IExecutionHandler context, TestResultsPad resultsPad) { this.test = test; this.context = context; this.monitor = new TestMonitor (resultsPad); this.resultsPad = resultsPad; resultsPad.InitializeTestRun (test); }
ProcessHostController GetHost (string id, bool shared, IExecutionHandler executionHandler) { if (!shared) return new ProcessHostController (id, 0, executionHandler); lock (this) { if (externalProcess == null) externalProcess = new ProcessHostController ("SharedHostProcess", 10000, null); return externalProcess; } }
IAsyncOperation RunTest (ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) { if (nav == null) return null; UnitTest test = nav.DataItem as UnitTest; if (test == null) return null; NUnitService.ResetResult (test.RootTest); this.buttonRun.Sensitive = false; this.buttonRunAll.Sensitive = false; this.buttonStop.Sensitive = true; if (bringToFront) IdeApp.Workbench.GetPad<TestPad> ().BringToFront (); runningTestOperation = testService.RunTest (test, mode); runningTestOperation.Completed += (OperationHandler) DispatchService.GuiDispatch (new OperationHandler (OnTestSessionCompleted)); return runningTestOperation; }
public IDisposable CreateExternalProcessObject (Type type, IExecutionHandler executionHandler, IList<string> userAssemblyPaths = null) { CheckRemoteType (type); return (IDisposable)GetHost (type.ToString (), false, executionHandler).CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths); }
public bool CanExecute (IBuildTarget entry, IExecutionHandler handler) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors); return entry.CanExecute (context, IdeApp.Workspace.ActiveConfiguration); }
public IDisposable CreateExternalProcessObject (string assemblyPath, string typeName, IExecutionHandler executionHandler, params string[] requiredAddins) { return (IDisposable) GetHost (typeName, false, executionHandler).CreateInstance (assemblyPath, typeName, requiredAddins); }
public bool CanExecuteFile (string file, IExecutionHandler handler) { ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors); return CanExecuteFile (file, context); }
public bool IsValidForRemoteHosting (IExecutionHandler handler) { string location = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location); location = Path.Combine (location, "mdhost.exe"); return handler.CanExecute (new DotNetExecutionCommand (location)); }