コード例 #1
0
		public void Start(string program, params string[] arguments)
		{
			lock (lockObj) {
				if (wasStarted)
					throw new InvalidOperationException();
				
				profilerRunner = new ProfilerRunner(psi, true, writer);
				profilerRunner.RunFinished += delegate { hasExited = true; };
				runningProcess = profilerRunner.Run();
				wasStarted = true;
			}
		}
コード例 #2
0
        public void Start(string program, params string[] arguments)
        {
            lock (lockObj) {
                if (wasStarted)
                {
                    throw new InvalidOperationException();
                }

                profilerRunner              = new ProfilerRunner(psi, true, writer);
                profilerRunner.RunFinished += delegate { hasExited = true; };
                runningProcess              = profilerRunner.Run();
                wasStarted = true;
            }
        }
コード例 #3
0
        void Start(ProcessStartInfo startInfo, SelectedTests selectedTests)
        {
            LogCommandLine(startInfo);

            string path = selectedTests.Project.GetSessionFileName();

            LoggingService.Info("starting profiler...");

            runner = new ProfilerRunner(startInfo, true, new UnitTestWriter(new ProfilingDataSQLiteWriter(path), GetUnitTestNames(selectedTests).ToArray()));

            runner.RunFinished += delegate {
                WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path));
                AfterFinish(selectedTests, path);
            };

            testResultsMonitor.TestFinished += OnTestFinished;
            testResultsMonitor.Start();
            runner.Run();
        }
コード例 #4
0
        public static ProfilerRunner CreateRunner(IProfilingDataWriter writer)
        {
            AbstractProject currentProj = ProjectService.CurrentProject as AbstractProject;

            if (currentProj == null)
            {
                return(null);
            }

            if (!currentProj.IsStartable)
            {
                if (MessageService.AskQuestion("${res:AddIns.Profiler.Messages.NoStartableProjectWantToProfileStartupProject}"))
                {
                    currentProj = ProjectService.OpenSolution.StartupProject as AbstractProject;
                    if (currentProj == null)
                    {
                        MessageService.ShowError("${res:AddIns.Profiler.Messages.NoStartableProjectFound}");
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }
            if (!File.Exists(currentProj.OutputAssemblyFullPath))
            {
                MessageService.ShowError("${res:AddIns.Profiler.Messages.FileNotFound}");
                return(null);
            }

            ProcessStartInfo startInfo;

            try {
                startInfo = currentProj.CreateStartInfo();
            } catch (ProjectStartException ex) {
                MessageService.ShowError(ex.Message);
                return(null);
            }
            ProfilerRunner runner = new ProfilerRunner(startInfo, true, writer);

            return(runner);
        }
コード例 #5
0
		void Start(ProcessStartInfo startInfo, SelectedTests selectedTests)
		{
			LogCommandLine(startInfo);
			
			string path = selectedTests.Project.GetSessionFileName();
			
			LoggingService.Info("starting profiler...");
			
			runner = new ProfilerRunner(startInfo, true, new UnitTestWriter(new ProfilingDataSQLiteWriter(path), GetUnitTestNames(selectedTests).ToArray()));
			
			runner.RunFinished += delegate {
				WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path));
				AfterFinish(selectedTests, path);
			};
			
			testResultsMonitor.TestFinished += OnTestFinished;
			testResultsMonitor.Start();
			runner.Run();
		}
コード例 #6
0
		protected override void RunTests(UnitTestApplicationStartHelper helper)
		{
			TestRunnerCategory.AppendLine(helper.GetCommandLine());
			
			ProcessStartInfo startInfo = new ProcessStartInfo(helper.UnitTestApplication);
			
			string path = helper.Project.GetSessionFileName();
			
			startInfo.Arguments = helper.GetArguments();
			startInfo.WorkingDirectory = UnitTestApplicationStartHelper.UnitTestApplicationDirectory;
			LoggingService.Info("starting profiler...");
			
			runner = new ProfilerRunner(startInfo, true, new ProfilingDataSQLiteWriter(path, true, GetUnitTestNames(helper).ToArray()));
			
			runner.RunFinished += delegate {
				WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path));
				AfterFinish(helper, path);
			};
			
			runner.Run();
		}
コード例 #7
0
		public static ProfilerRunner CreateRunner(IProfilingDataWriter writer)
		{
			AbstractProject currentProj = ProjectService.CurrentProject as AbstractProject;
			
			if (currentProj == null)
				return null;
			
			if (!currentProj.IsStartable) {
				if (MessageService.AskQuestion("${res:AddIns.Profiler.Messages.NoStartableProjectWantToProfileStartupProject}")) {
					currentProj = ProjectService.OpenSolution.StartupProject as AbstractProject;
					if (currentProj == null) {
						MessageService.ShowError("${res:AddIns.Profiler.Messages.NoStartableProjectFound}");
						return null;
					}
				} else
					return null;
			}
			if (!File.Exists(currentProj.OutputAssemblyFullPath)) {
				MessageService.ShowError("${res:AddIns.Profiler.Messages.FileNotFound}");
				return null;
			}
			
			ProcessStartInfo startInfo;
			try {
				startInfo = currentProj.CreateStartInfo();
			} catch (ProjectStartException ex) {
				MessageService.ShowError(ex.Message);
				return null;
			}
			ProfilerRunner runner = new ProfilerRunner(startInfo, true, writer);
			return runner;
		}