Пример #1
0
            public Harness(string testOutputDirectory)
            {
                Context = BuildXLContext.CreateInstanceForTesting();
                var config = ConfigurationHelpers.GetDefaultForTesting(Context.PathTable, AbsolutePath.Create(Context.PathTable, System.IO.Path.Combine(testOutputDirectory, "config.dc")));

                m_env = new DummyPipExecutionEnvironment(
                    CreateLoggingContextForTest(),
                    Context,
                    config,
                    subst: FileUtilities.TryGetSubstSourceAndTarget(testOutputDirectory, out var substSource, out var substTarget)
                        ? (substSource, substTarget)
                        : default((string, string)?),
                    sandboxConnection: GetSandboxConnection());
                var sealContentsCache = new ConcurrentBigMap <DirectoryArtifact, int[]>();

                Table = Context.PathTable;

                // Create the paths in the PathTable before creating the CachedFileSystemView
                Path(a);
                Path(b);
                Path(c);
                Path(d);
                Path(e);
                Path(f);
                Path(g);
                Path(h);
                Path(i);
                Path(j);
                Path(k);
                Path(l);

                m_fileSystem = new PipFileSystemView();
                m_fileSystem.Initialize(Table);
            }
Пример #2
0
            /// <summary>
            /// Seal the harness.
            /// </summary>
            public void Seal()
            {
                if (IsSealed)
                {
                    return;
                }

                Environment        = new DummyPipExecutionEnvironment(CreateLoggingContextForTest(), m_context, Configuration, sandboxedKextConnection: GetSandboxedKextConnection());
                FileContentManager = new FileContentManager(Environment, new NullOperationTracker());
                UntrackedOpContext = OperationContext.CreateUntracked(Environment.LoggingContext);

                IsSealed = true;
            }