public IRunResult Run(IRunIntent intent) { _listener.OnRunStarted(intent); IRunResult result; try { var suiteResults = intent.Intents .Select(x => Tuple.Create(x, Assembly.LoadFrom(x.Identity.Relative))) .GroupBy(x => GetTestType(x.Item2)) .OrderByDescending(x => x.Key) .SelectMany( group => group #if PARALLEL .AsParallel() .WithCancellation(intent.CancellationTokenSource.Token) .WithExecutionMode(ParallelExecutionMode.ForceParallelism) #endif .Select(x => RunAssemblySuites(x.Item2, intent.ShadowCopyPath, intent.CancellationTokenSource, x.Item1))).ToList(); result = _resultFactory.CreateRunResult(intent, suiteResults); } catch (Exception exception) { _listener.OnError(ExceptionDescriptor.Create(exception)); throw; } _listener.OnRunFinished(result); return(result); }
public IRunResult CreateRunResult(IRunIntent intent, IEnumerable <ISuiteResult> suiteResults) { var suiteResultsList = suiteResults.ToList(); var state = GetOverallState(Convert(suiteResultsList)); return(new RunResult(intent.Identity, "You're so great!", state, suiteResultsList)); }
public static void AddTypes(this IRunIntent runIntent, IEnumerable <Type> types) { foreach (var assemblyWithTypes in types.GroupBy(x => x.Assembly)) { var intent = Intent.Create(GetIdentity(assemblyWithTypes.Key)); runIntent.AddIntent(intent); assemblyWithTypes.ForEach(x => intent.AddIntent(Intent.Create(GetIdentity(x)))); } }
public static IRunResult Run(IRunIntent runIntent, params IRunListener[] listeners) { var listener = CrossAppDomainRunListener.Create(listeners); var builder = new ContainerBuilder(); var evaluationModule = new EvaluationModule(listener, runIntent.CreateSeparateAppDomains); builder.RegisterModule(evaluationModule); var container = builder.Build(); var rootRunner = container.Resolve<IRootRunner>(); return rootRunner.Run(runIntent); }
public static IRunResult Run(IRunIntent runIntent, params IRunListener[] listeners) { var listener = new CompositeRunListener(listeners); var builder = new ContainerBuilder(); var evaluationModule = new EvaluationModule(listener, runIntent.CreateSeparateAppDomains); builder.RegisterModule(evaluationModule); var container = builder.Build(); var rootRunner = container.Resolve <IRootRunner>(); return(rootRunner.Run(runIntent)); }
public override void OnRunStarted(IRunIntent intent) { _listeners.ForEach(x => x.OnRunStarted(intent)); }
public virtual void OnRunStarted(IRunIntent intent) { }
public static void AddAssemblies(this IRunIntent runIntent, IEnumerable <Assembly> assemblies) { assemblies.Select(GetIdentity).Select(Intent.Create).ForEach(runIntent.AddIntent); }
public static void AddType(this IRunIntent runIntent, Type type) { runIntent.AddTypes(new[] { type }); }
public IRunResult Run(IRunIntent intent) { _listener.OnRunStarted(intent); IRunResult result; try { var suiteResults = intent.Intents .Select(x => Tuple.Create(x, Assembly.LoadFrom(x.Identity.Relative))) //.OrderBy(x => GetTestType(x.Item2)) //.Select(x => RunAssemblySuites(x.Item2, intent.ShadowCopyPath, intent.CancellationTokenSource, x.Item1)).ToList(); .GroupBy(x => GetTestType(x.Item2)) .OrderByDescending(x => x.Key) .SelectMany( group => group #if PARALLEL .AsParallel() .WithCancellation(intent.CancellationTokenSource.Token) .WithExecutionMode(ParallelExecutionMode.ForceParallelism) #endif .Select(x => RunAssemblySuites(x.Item2, intent.ShadowCopyPath, intent.CancellationTokenSource, x.Item1))).ToList(); result = _resultFactory.CreateRunResult(intent, suiteResults); } catch (Exception exception) { _listener.OnError(ExceptionDescriptor.Create(exception)); throw; } _listener.OnRunFinished(result); return result; }
public void OnRunStarted(IRunIntent intent) { _listeners.ForEach(x => x.OnRunStarted(intent)); }
public void OnRunStarted(IRunIntent intent) { _listener.OnRunStarted(intent); }