protected virtual BuildXLEngineResult CreateAndRunEngine(
            ICommandLineConfiguration config,
            AppDeployment appDeployment,
            string testRootDirectory,
            bool rememberAllChangedTrackedInputs,
            out BuildXLEngine engine,
            Action <EngineTestHooksData> verifyEngineTestHooksData = null,
            TestCache testCache = null,
            IDetoursEventListener detoursListener = null)
        {
            testCache = testCache ?? TestCache;

            using (EngineTestHooksData testHooks = new EngineTestHooksData
            {
                AppDeployment = appDeployment,
                CacheFactory = () => new EngineCache(
                    testCache.GetArtifacts(),
                    testCache.Fingerprints),
                DetoursListener = detoursListener,
            })
            {
                engine = CreateEngine(config, appDeployment, testRootDirectory, rememberAllChangedTrackedInputs, verifyEngineTestHooksData);

                // Ignore DX222 for csc.exe being outside of src directory
                IgnoreWarnings();

                if (engine == null)
                {
                    return(null);
                }

                engine.TestHooks = testHooks;

                var result = engine.RunForFrontEndTests(LoggingContext);
                return(result);
            }
        }
        protected BuildXLEngineResult RunCustomJavaScriptProjects(
            ICommandLineConfiguration config,
            TestCache testCache = null,
            IDetoursEventListener detoursListener = null)
        {
            using (var tempFiles = new TempFileStorage(canGetFileNames: true, rootPath: TestOutputDirectory))
            {
                var appDeployment = CreateAppDeployment(tempFiles);

                ((CommandLineConfiguration)config).Engine.Phase           = Phase;
                ((CommandLineConfiguration)config).Sandbox.FileSystemMode = FileSystemMode.RealAndMinimalPipGraph;

                var engineResult = CreateAndRunEngine(
                    config,
                    appDeployment,
                    testRootDirectory: null,
                    rememberAllChangedTrackedInputs: true,
                    engine: out var engine,
                    testCache: testCache,
                    detoursListener: detoursListener);

                return(engineResult);
            }
        }
Example #3
0
        protected BuildXLEngineResult RunEngineWithConfig(ICommandLineConfiguration config, TestCache testCache = null, IDetoursEventListener detoursListener = null)
        {
            using (var tempFiles = new TempFileStorage(canGetFileNames: true, rootPath: TestOutputDirectory))
            {
                var appDeployment = CreateAppDeployment(tempFiles);

                // Set the specified phase
                ((CommandLineConfiguration)config).Engine.Phase = Phase;

                var engineResult = CreateAndRunEngine(
                    config,
                    appDeployment,
                    testRootDirectory: null,
                    rememberAllChangedTrackedInputs: true,
                    engine: out var engine,
                    testCache: testCache,
                    detoursListener: detoursListener);

                return(engineResult);
            }
        }
Example #4
0
 protected SandboxedProcessInfo EchoProcessInfo(string message = "Success", IDetoursEventListener detoursListener = null)
 => ToProcessInfo(EchoProcess(message), detoursListener: detoursListener);
Example #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 public LocalWorker(IScheduleConfiguration scheduleConfig, IPipQueue pipQueue, IDetoursEventListener detoursListener, PipExecutionContext context)
     : base(workerId: 0, name: "#0 (Local)", context: context)
 {
     TotalProcessSlots          = scheduleConfig.EffectiveMaxProcesses;
     TotalCacheLookupSlots      = scheduleConfig.MaxCacheLookup;
     TotalLightSlots            = scheduleConfig.MaxLightProcesses;
     TotalMaterializeInputSlots = scheduleConfig.MaxMaterialize;
     m_detoursListener          = detoursListener;
     m_pipQueue = pipQueue;
     Start();
 }