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();
        }
Exemple #2
0
        void SetPartCoverRunnerProperties(UnitTestApplicationStartHelper helper)
        {
            string            partCoverOutputDirectory = GetPartCoverOutputDirectory(helper.Project);
            PartCoverSettings settings = GetPartCoverSettings(helper.Project);

            // By default get the code coverage for everything if
            // no include or exclude regular expressions have been
            // set for this project. Note that the CodeCoverageResults
            // will ignore any type that has no source code available
            // for it even though the type may be in the Part Cover
            // results file.
            if (settings.Include.Count == 0)
            {
                settings.Include.Add("[*]*");
            }

            runner.PartCoverFileName      = GetPartCoverFileName();
            runner.Target                 = helper.UnitTestApplication;
            runner.TargetArguments        = helper.GetArguments();
            runner.TargetWorkingDirectory = Path.GetDirectoryName(helper.Assemblies[0]);
            runner.Output                 = Path.Combine(partCoverOutputDirectory, "Coverage.Xml");
            AddStringsToCollection(settings.Include, runner.Include);
            AddStringsToCollection(settings.Exclude, runner.Exclude);
        }
        public void TestResultsFile()
        {
            helper.Initialize(project, null, null);
            helper.NoLogo     = false;
            helper.ShadowCopy = true;
            helper.Results    = @"C:\results.txt";

            string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /results=\"C:\\results.txt\"";

            Assert.AreEqual(expectedCommandLine, helper.GetArguments());
        }