Пример #1
0
        public void RebuildAfterCleanObjectsWithLazyOutputMaterialization()
        {
            BeforeRebuild("Build #1");
            Configuration.Schedule.EnableLazyOutputMaterialization = true;

            Configuration.Schedule.EnableLazyWriteFileMaterialization = true;
            Configuration.Engine.DefaultFilter = @"output='*\HelloWorldFinal.out'";

            BuildCounters counters = Build("Build #2");

            // Execute HelloWorldFinal.exe.
            counters.VerifyNumberOfPipsExecuted(1);

            // Cache hit for everything else.
            counters.VerifyNumberOfProcessPipsCached(TotalPips - 1);
            counters.VerifyNumberOfPipsBringContentToLocal(TotalPips - 1);

            counters.VerifyNumberOfCachedOutputsUpToDate(0);

            // Intermediates which are inputs to executed process are materialized from cache
            // \obj\HelloWorldIntermediate.out (output)
            counters.VerifyNumberOfCachedOutputsCopied(1);

            // Copy file outputs (actually deployed from cache but CopyFile outputs are logged as produced):
            // \obj\deploy\bin\HelloWorldFinal.exe(output)
            // \obj\deploy\bin\HelloWorldFinal.exe.config(output)

            // Output of executed process (HelloWorldFinal.exe):
            // \obj\HelloWorldFinal.out (output)

            // Write file output (NOT MATERIALIZED due to lazy materialization):
            // \obj\HelloWorld.cs (output)
            counters.VerifyNumberOfOutputsProduced(Configuration.Schedule.EnableLazyWriteFileMaterialization ? 3 : 4);
        }
Пример #2
0
        public void RebuildAfterCleanObjectsWithoutLazyOutputMaterialization()
        {
            BeforeRebuild("Build #1");
            Configuration.Schedule.EnableLazyOutputMaterialization = false;

            BuildCounters counters = Build("Build #2");

            // Execute HelloWorldFinal.exe.
            counters.VerifyNumberOfPipsExecuted(1);

            // Csc-compile HelloWorldIntermediate.exe, HelloWorldFinal.exe.
            // Running HelloWorldIntermediate.exe.
            counters.VerifyNumberOfProcessPipsCached(3);

            counters.VerifyNumberOfCachedOutputsUpToDate(0);

            // Because obj\ was destroyed.
            // Fetch HelloWorldIntermediate.exe, HelloWorldFinal.exe.
            // Fetch HelloWorldIntermediate.out.
            counters.VerifyNumberOfCachedOutputsCopied(3);

            // Deploy HelloWorldIntermediate.exe, HelloWolrdIntermediate.exe.config.
            // Deploy HelloWorldFinal.exe, HelloWolrdFinal.exe.config.
            // Produce HelloWorldFinal.out.
            // Produce HelloWorld.cs
            counters.VerifyNumberOfOutputsProduced(6);
        }
Пример #3
0
        public void IncrementalBuildCopiesContentWhenOutputsDeletedWithLazyOutputMaterialization()
        {
            SetupTestState();
            Configuration.Engine.DefaultFilter = @"output='" + Path.Combine(Configuration.Layout.ObjectDirectory.ToString(PathTable), "combined") + Path.DirectorySeparatorChar + "*'";
            EagerCleanBuild("Build #1");

            Paths buildPaths = GetBuildPaths();

            File.Delete(buildPaths.CopyOfSourceFile1Path);
            File.Delete(buildPaths.FinalOutputPath);

            BuildCounters counters = Build("Build #2");

            counters.VerifyNumberOfPipsExecuted(0);
            counters.VerifyNumberOfProcessPipsCached(TotalPips);
            counters.VerifyNumberOfCachedOutputsUpToDate(0);

            // Although CopyOfSourceFile1Path is deleted, since output materialization is lazy, the file is not materialized.
            counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs - 1);
        }
Пример #4
0
        public void IncrementalBuildCopiesContentWhenOutputsDeleted()
        {
            SetupTestState();
            EagerCleanBuild("Build #1");

            Paths buildPaths = GetBuildPaths();

            File.Delete(buildPaths.CopyOfSourceFile1Path);
            File.Delete(buildPaths.FinalOutputPath);

            Configuration.Schedule.EnableLazyOutputMaterialization = false;

            BuildCounters counters = Build("Build #2");

            counters.VerifyNumberOfPipsExecuted(0);
            counters.VerifyNumberOfProcessPipsCached(TotalPips);
            counters.VerifyNumberOfCachedOutputsUpToDate(0);
            counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs);

            // The next build should know that outputs are up to date, despite them having been re-deployed rather than re-computed last time.
            EagerBuildWithoutChanges("Build #3");
        }