private void ApplyFilter(IProgressMonitor progressMonitor, FilterInfo filterInfo)
        {
            var filterSet = FilterUtils.ParseTestFilterSet(filterInfo.FilterExpr);
            var command   = commandFactory.CreateApplyFilterCommand(filterSet);

            command.Execute(progressMonitor);
        }
Example #2
0
        public void FilterSets(string filterSetExpr, string parsedFilterSetString)
        {
            FilterSet <ITestDescriptor> parsedFilterSet = FilterUtils.ParseTestFilterSet(filterSetExpr);

            Assert.IsNotNull(parsedFilterSet);
            Assert.AreEqual(parsedFilterSetString, parsedFilterSet.ToFilterSetExpr());
        }
        public void ApplyFilter(string filter)
        {
            var filterSet = FilterUtils.ParseTestFilterSet(filter);
            var command   = commandFactory.CreateApplyFilterCommand(filterSet);

            taskManager.QueueTask(command);
        }
Example #4
0
        private FilterSet <ITestDescriptor> GetFilterSet()
        {
            if (String.IsNullOrEmpty(Filter))
            {
                return(FilterSet <ITestDescriptor> .Empty);
            }

            return(FilterUtils.ParseTestFilterSet(Filter));
        }
        //not picking up
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, ITestExecutionRecorder testExecutionRecorder)
        {
            _launcher = new TestLauncher();
            _launcher.RuntimeSetup = new RuntimeSetup();
            //_launcher.TestProject.

            foreach (var test in tests)
            {
                _launcher.AddFilePattern(test.Source);
                _launcher.TestExecutionOptions.FilterSet = FilterUtils.ParseTestFilterSet("ExactType:" + test.DisplayName);
            }

            RunTests(testExecutionRecorder);
        }
Example #6
0
        internal static void ConfigureLauncherFromArguments(TestLauncher launcher, EchoArguments arguments)
        {
            launcher.RuntimeSetup = new RuntimeSetup();
            GenericCollectionUtils.ForEach(arguments.PluginDirectories, x => launcher.RuntimeSetup.AddPluginDirectory(x));

            if (arguments.ShadowCopy.HasValue)
            {
                launcher.TestProject.TestPackage.ShadowCopy = arguments.ShadowCopy.Value;
            }

            if (arguments.Debug.HasValue && arguments.Debug.Value)
            {
                launcher.TestProject.TestPackage.DebuggerSetup = new DebuggerSetup();
            }

            if (arguments.ApplicationBaseDirectory != null)
            {
                launcher.TestProject.TestPackage.ApplicationBaseDirectory = new DirectoryInfo(arguments.ApplicationBaseDirectory);
            }

            if (arguments.WorkingDirectory != null)
            {
                launcher.TestProject.TestPackage.WorkingDirectory = new DirectoryInfo(arguments.WorkingDirectory);
            }

            if (arguments.RuntimeVersion != null)
            {
                launcher.TestProject.TestPackage.RuntimeVersion = arguments.RuntimeVersion;
            }

            GenericCollectionUtils.ForEach(arguments.Files, launcher.AddFilePattern);

            foreach (string hintDirectory in arguments.HintDirectories)
            {
                launcher.TestProject.TestPackage.AddHintDirectory(new DirectoryInfo(hintDirectory));
            }

            if (arguments.ReportDirectory != null)
            {
                launcher.TestProject.ReportDirectory = arguments.ReportDirectory;
            }

            if (arguments.ReportNameFormat != null)
            {
                launcher.TestProject.ReportNameFormat = arguments.ReportNameFormat;
            }

            launcher.TestProject.ReportArchive = ReportArchive.Parse(arguments.ReportArchive);
            GenericCollectionUtils.ForEach(arguments.ReportTypes, launcher.AddReportFormat);

            if (arguments.RunnerType != null)
            {
                launcher.TestProject.TestRunnerFactoryName = arguments.RunnerType;
            }
            GenericCollectionUtils.ForEach(arguments.RunnerExtensions, x => launcher.TestProject.AddTestRunnerExtensionSpecification(x));

            foreach (string option in arguments.ReportFormatterProperties)
            {
                KeyValuePair <string, string> pair = StringUtils.ParseKeyValuePair(option);
                launcher.ReportFormatterOptions.AddProperty(pair.Key, pair.Value);
            }

            foreach (string option in arguments.RunnerProperties)
            {
                KeyValuePair <string, string> pair = StringUtils.ParseKeyValuePair(option);
                launcher.TestRunnerOptions.AddProperty(pair.Key, pair.Value);
            }

            launcher.DoNotRun          = arguments.DoNotRun;
            launcher.IgnoreAnnotations = arguments.IgnoreAnnotations;

            if (!String.IsNullOrEmpty(arguments.Filter))
            {
                launcher.TestExecutionOptions.FilterSet = FilterUtils.ParseTestFilterSet(arguments.Filter);
            }

            launcher.EchoResults = !arguments.NoEchoResults;
            launcher.ShowReports = arguments.ShowReports;

            if (arguments.RunTimeLimitInSeconds >= 0)
            {
                launcher.RunTimeLimit = TimeSpan.FromSeconds(arguments.RunTimeLimitInSeconds);
            }
        }