public AppDomainRunner(ISpecificationRunListener listener, RunOptions options)
        {
            _listener = new RemoteRunListener(listener);
            _options = options;

            _signalRunStart = new InvokeOnce(listener.OnRunStart);
            _signalRunEnd = new InvokeOnce(listener.OnRunEnd);
        }
        private static ExitCode RunAssembly(Assembly assembly, RunOptions runOptions)
        {
            ISpecificationRunListener listener = new BufferedAssemblyTeamCityReporter(WriteToTeamCity);

            ISpecificationRunner specificationRunner = new AppDomainRunner(listener, runOptions);

            specificationRunner.RunAssembly(new AssemblyPath(assembly.Location));

            if (listener is ISpecificationResultProvider) {
                var errorProvider = (ISpecificationResultProvider) listener;
                if (errorProvider.FailureOccurred)
                    return ExitCode.Failure;
            }

            return ExitCode.Success;
        }
        private static async Task<ExitCode> RunAllInParallel(List<Assembly> assemblies, RunOptions runOptions, uint threads)
        {
            _teamCityGlobalReporter.OnRunStart();

            var worker = new MultiThreadedWorker<Assembly, ExitCode>(assemblies,
                                                                     (assembly) => RunAssembly(assembly, runOptions),
                                                                     threads);
            IEnumerable<ExitCode> result = await worker.Run();

            FlushTeamCityOutput();

            _teamCityGlobalReporter.OnRunEnd();

            if (result.Any(e => e == ExitCode.Error))
                return ExitCode.Error;
            else if (result.Any(e => e == ExitCode.Failure))
                return ExitCode.Failure;
            else
                return ExitCode.Success;
        }
Beispiel #4
0
 private static void AppendFilters(XElement root, RunOptions runOptions)
 {
     AppendItems(root, runOptions.Filters, "filters", "filter");
 }
Beispiel #5
0
 private static void AppendExcludeTags(XElement root, RunOptions runOptions)
 {
     AppendItems(root, runOptions.ExcludeTags, "excludetags", "tag");
 }
 private static void AppendFilters(XElement root, RunOptions runOptions)
 {
     AppendItems(root, runOptions.Filters, "filters", "filter");
 }
 private static void AppendExcludeTags(XElement root, RunOptions runOptions)
 {
     AppendItems(root, runOptions.ExcludeTags, "excludetags", "tag");
 }