protected TestPlanBase(DefaultTestRunner runner, TestRun testRun, TestRunnerOptions normalized)
            {
                _normalizedOpts = normalized;
                _runner         = runner;
                _root           = new RootNode(runner, testRun);
                _root.Initialize();

                normalized.PreviousRun.ApplyTo(testRun);
                if (normalized.RerunPreviousFailures)
                {
                    if (normalized.PreviousRun.FailureReason.IsFailure())
                    {
                        normalized.PlanFilter.Tags.Add(
                            TestTagPredicate.Previously(TestStatus.Failed)
                            );
                    }
                    else
                    {
                        Log.Warn("No previous failures, re-running all tests...");
                    }
                }

                // Apply filter rules from the options
                _normalizedOpts.PlanFilter.Apply(testRun, normalized);

                _willRun = PlanOrder.Where(p => p.IsLeafThatWillRun).Select(n => (TestCaseInfo)n.Unit).ToList();
            }
Ejemplo n.º 2
0
 public static TestTagPredicate Not(TestTagPredicate item)
 {
     if (item == null)
     {
         throw new ArgumentNullException(nameof(item));
     }
     return(new NegatedImpl(item));
 }
Ejemplo n.º 3
0
        private static Exception _TryParse(string text, out TestTagPredicate result)
        {
            if (text == null)
            {
                result = null;
                return(new ArgumentException());
            }
            var items = Array.ConvertAll(
                text.Split(','),
                _TryParseOnePossiblyNegated
                );

            if (items.Any(i => i == null))
            {
                result = null;
                return(new FormatException());
            }
            result = Or(items);
            return(null);
        }
Ejemplo n.º 4
0
 public static bool TryParse(string text, out TestTagPredicate result)
 {
     return(_TryParse(text, out result) == null);
 }
Ejemplo n.º 5
0
 public NegatedImpl(TestTagPredicate inner)
 {
     _inner = inner;
 }