Beispiel #1
0
        private FrontEndHostController CreateHost()
        {
            var factory = new FrontEndFactory();

            factory.AddFrontEnd(new DummyFrontEnd1());
            factory.TrySeal(new LoggingContext("UnitTest"));

            var controller = new FrontEndHostController(factory, new DScriptWorkspaceResolverFactory(), new EvaluationScheduler(degreeOfParallelism: 8), collectMemoryAsSoonAsPossible: false);

            var context = BuildXLContext.CreateInstanceForTesting();

            var fileSystem = new InMemoryFileSystem(context.PathTable);

            ((IFrontEndController)controller).InitializeHost(
                new FrontEndContext(context, new LoggingContext("UnitTest"), fileSystem),
                new ConfigurationImpl()
            {
                FrontEnd = new FrontEndConfiguration()
                {
                    MaxFrontEndConcurrency = 1,
                }
            });

            var inMemoryCache = new EngineCache(
                new InMemoryArtifactContentCache(context),
                new InMemoryTwoPhaseFingerprintStore());

            controller.InitializeInternalForTesting(
                Task.FromResult(new Possible <EngineCache>(inMemoryCache)),
                AbsolutePath.Create(context.PathTable, TestOutputDirectory));

            return(controller);
        }